mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
The current web container's command destroys anything you might have in your local DB from a previous session, assuming you always want start from a clean environment. This is hardly the case and makes `docker-compose up` take quite long. What if you just stopped containers temporally while developing? This changes the approach to not assume anything. If you need to install a new gem or reset your DB just run the commands you would without docker. You can run anything you want with `docker-compose run web bundle exec <rails/rake command>` anyway. For someone setting things for the first time, the `Dockerfile` process still installs all dependencies.
38 lines
846 B
YAML
38 lines
846 B
YAML
version: '3'
|
|
|
|
services:
|
|
db:
|
|
image: postgres:9.5
|
|
restart: always
|
|
environment:
|
|
POSTGRES_PASSWORD: f00d
|
|
POSTGRES_USER: ofn
|
|
POSTGRES_DB: open_food_network_dev
|
|
volumes:
|
|
- 'postgres:/var/lib/postgresql/data'
|
|
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
|
|
- ./config/application.yml.example:/usr/src/app/config/application.yml
|
|
depends_on:
|
|
- db
|
|
environment:
|
|
ADMIN_EMAIL: ofn@example.com
|
|
ADMIN_PASSWORD: ofn123
|
|
OFN_DB_HOST: db
|
|
command: >
|
|
bash -c "wait-for-it -t 30 db:5432 &&
|
|
rm -f tmp/pids/server.pid &&
|
|
bundle exec rails s -p 3000 -b '0.0.0.0'"
|
|
|
|
volumes:
|
|
gems:
|
|
postgres:
|