ToolJet/docker-compose.yaml
Ashish 2c59616b70
Feature: docker-compose deployment (#388)
* separate dockerfile for tooljet client in development mode

* production dockerfile for tooljet client

* reference the tooljet clients dev dockerfile in the docker-compose file

* use a fallback url for API_URL in cases where TOOLJET_SERVER_URL is not defined

* nginx config file for the front-end

* docker-compose file for production deploys

* dont run postgres inside docker-compose

* use an entrypoint script for setting the server host for nginx

* separate volume for fallback certs

* add docs for docker-compose deployment

* add required database keys in the .env.example file

* address review comments
2021-07-12 14:45:42 +05:30

67 lines
1.4 KiB
YAML

version: '3'
services:
base: &base
build:
context: .
dockerfile: ./docker/server.Dockerfile.dev
args:
RAILS_ENV: 'development'
tty: true
stdin_open: true
image: tooljet:development
env_file: .env
client:
<<: *base
build:
context: ./frontend
dockerfile: ../docker/client.Dockerfile.dev
image: tooljet-client:development
volumes:
- ./frontend:/app:delegated
- /app/node_modules/
ports:
- 8082:8082
environment:
- WEBPACKER_DEV_SERVER_HOST=0.0.0.0
- NODE_ENV=development
command: npm start
server:
<<: *base
build:
context: .
dockerfile: ./docker/server.Dockerfile.dev
image: tooljet-server:development
volumes:
- ./:/app:delegated
# - bundle:/usr/local/bundle
depends_on:
- postgres
ports:
- 3000:3000
env_file: .env
environment:
- RAILS_ENV=development
- DB_PASSWORD=postgres
- DB_HOST=postgres
entrypoint: ["bash", "/app/docker/entrypoints/server.sh"]
command: ["bundle", "exec", "rails", "s", "-p", "3000", "-b", "0.0.0.0"]
postgres:
image: postgres:12
restart: always
volumes:
- postgres:/data/postgres
environment:
- POSTGRES_DB=tooljet_development
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
volumes:
postgres:
node_modules:
cache:
bundle: