Last active
October 27, 2016 09:02
-
-
Save chrisedington/a89c344d01328996447e6ecfc34a5f53 to your computer and use it in GitHub Desktop.
This file contains 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
# service configuration for our dockerized Rails app | |
app: | |
# use the Dockerfile next to this file | |
build: . | |
# sources environment variable configuration for our app | |
env_file: .env | |
# rely on the RAILS_ENV value of the host machine | |
environment: | |
RAILS_ENV: $RAILS_ENV | |
# makes the app container aware of the DB container | |
links: | |
- db | |
# expose the port we configured Unicorn to bind to | |
expose: | |
- "3000" | |
# service configuration for our database | |
db: | |
# use the preferred version of the official Postgres image | |
# see https://hub.docker.com/_/postgres/ | |
image: postgres:9.4.5 | |
# persist the database between containers by storing it in a volume | |
volumes: | |
- myapp-pg:/var/lib/postgresql/data | |
# service configuration for our web server | |
web: | |
# set the build context to the root of the Rails app | |
build: . | |
# build with a different Dockerfile | |
dockerfile: config/containers/Dockerfile-nginx | |
# makes the web container aware of the app container | |
links: | |
- app | |
# expose the port we configured Nginx to bind to | |
ports: | |
- "80:80" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment