Files
openfoodnetwork/compose.yaml

75 lines
1.6 KiB
YAML

services:
db:
image: postgres:10.19
restart: always
environment:
POSTGRES_PASSWORD: f00d
POSTGRES_USER: ofn
ports:
- 5432:5432
volumes:
- 'postgres:/var/lib/postgresql/data'
redis:
image: redis
web:
tty: true
stdin_open: true
build: .
ports:
- 3000:3000
volumes:
- .:/usr/src/app
- gems:/bundles
- ./config/database.yml:/usr/src/app/config/database.yml
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
depends_on:
- db
- redis
environment:
DOCKER: true
DEV_CACHING: true
OFN_DB_HOST: db
OFN_REDIS_URL: redis://redis/
OFN_REDIS_JOBS_URL: redis://redis
OFN_REDIS_TEST_URL: redis://redis/3
command: >
bash -c "rm -f tmp/pids/server.pid &&
(bundle check || bundle install) &&
bundle exec rails db:prepare &&
yarn install &&
bundle exec rails s -b 0.0.0.0 -p 3000"
sidekiq:
build: .
command: bundle exec sidekiq
depends_on:
- db
- redis
volumes:
- .:/usr/src/app
- gems:/bundles
environment:
DOCKER: true
DEV_CACHING: true
OFN_DB_HOST: db
OFN_REDIS_URL: redis://redis/
OFN_REDIS_JOBS_URL: redis://redis
OFN_REDIS_TEST_URL: redis://redis/3
webpack:
build: .
command: ./bin/webpack-dev-server
depends_on:
- web
ports:
- "3035:3035"
volumes:
- .:/usr/src/app
- gems:/bundles
environment:
WEBPACKER_DEV_SERVER_HOST: 0.0.0.0
volumes:
gems:
postgres: