Chatwoot/docker-compose.yaml
petebytes 3f403c9e7a Improve docker compose performance (#347)   🤩
* Fix warning Integrity check: System parameters don't match

* Reduce commands required to use docker-compose and update quick-setup doc

Data will still persist when stopping and restarting containers.
To destroy the data can use docker-compose down --volumes

* Moved webpacker-dev-server to its own service

* cache bundle and yarn - improve volume performance - env conditional statements

* Fix inconsistent build results found during testing
2019-12-05 16:42:46 +05:30

71 lines
1.4 KiB
YAML

version: '3'
volumes:
postgres:
redis:
bundle:
packs:
node_modules:
services:
server: &server
build:
context: .
dockerfile: ./docker/Dockerfile
args:
BUNDLE_WITHOUT: ''
RAILS_ENV: 'development'
RAILS_SERVE_STATIC_FILES: 'false'
volumes:
- ./:/app:cached
- bundle:/bundle:delegated
- packs:/app/public/packs
- node_modules:/app/node_modules
links:
- postgres
- redis
ports:
- '3000:3000'
environment:
- REDIS_URL=redis://redis:6379
- POSTGRES_HOST=postgres
- RAILS_ENV=development
- WEBPACKER_DEV_SERVER_HOST=webpacker
command: ["bundle", "exec", "rails", "s", "-p", "3000", "-b", "0.0.0.0"]
webpacker:
<<: *server
command: ./bin/webpack-dev-server
depends_on:
- "server"
ports:
- '3035:3035'
volumes:
- .:/app:cached
- bundle:/bundle
- node_modules:/app/node_modules
- packs:/app/public/packs
environment:
- "NODE_ENV=development"
- "RAILS_ENV=development"
- "WEBPACKER_DEV_SERVER_HOST=0.0.0.0"
postgres:
image: postgres:9.6
restart: always
ports:
- '5432:5432'
volumes:
- postgres:/data/postgres
environment:
- POSTGRES_DB=chatwoot
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=
redis:
image: redis:alpine
restart: always
volumes:
- redis:/data/redis
ports:
- '6379:6379'