Last active
June 22, 2017 11:41
-
-
Save ulrikstrid/9b545ad1c3dc7f7e4f70f5a2ec3951a5 to your computer and use it in GitHub Desktop.
Docker for create react app and node backend
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
version: '3' | |
volumes: | |
database_data: | |
driver: local | |
services: | |
################################ | |
# Setup postgres container | |
################################ | |
db: | |
image: postgres:latest | |
volumes: | |
- database_data:/var/lib/postgresql/data | |
################################ | |
# Setup node container | |
################################ | |
server: | |
build: ./server | |
expose: | |
- 5000 | |
ports: | |
- 5000:5000 | |
volumes: | |
- ./server:/usr/src/app/ | |
links: | |
- db | |
environment: | |
- PGHOST=db | |
- PGDATABASE=postgres | |
- PGUSER=postgres | |
################################ | |
# Setup frontend container | |
################################ | |
frontend: | |
build: ./frontend | |
expose: | |
- 4000 | |
ports: | |
- 4000:3000 | |
volumes: | |
- ./frontend/src:/usr/src/app/src | |
- ./frontend/public:/usr/src/app/public | |
links: | |
- server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment