Last active
November 1, 2019 05:27
-
-
Save RobBikmansurov/7aedbdd340b0d51e98dcb7304d8c2d31 to your computer and use it in GitHub Desktop.
docker-compose.yml for Rails and PostgreSQL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # docker-compose.yml | |
| # docker-compose build | |
| # docker-compose run web bundle install | |
| # docker-compose run web rake db:create | |
| # docker-compose run web rake db:setup | |
| # docker-compose up | |
| # docker-compose down | |
| version: '3' | |
| services: | |
| db: | |
| image: postgres:11-alpine | |
| environment: | |
| POSTGRES_PASSWORD: secret | |
| volumes: | |
| - db-data:/var/lib/postgresql/data:cached | |
| web: | |
| build: | |
| context: . | |
| dockerfile: Dockerfile | |
| command: /bin/bash -c "rm -f /tmp/server.pid && bundle exec rails server -b 0.0.0.0 -P /tmp/server.pid" | |
| ports: | |
| - 3000:3000 | |
| depends_on: | |
| - db | |
| volumes: | |
| - .:/app | |
| volumes: | |
| db-data: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment