Skip to content

Instantly share code, notes, and snippets.

@ulrikstrid
Last active June 22, 2017 11:41
Show Gist options
  • Save ulrikstrid/9b545ad1c3dc7f7e4f70f5a2ec3951a5 to your computer and use it in GitHub Desktop.
Save ulrikstrid/9b545ad1c3dc7f7e4f70f5a2ec3951a5 to your computer and use it in GitHub Desktop.
Docker for create react app and node backend
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