Skip to content

Instantly share code, notes, and snippets.

@agusrichard
Created November 4, 2021 20:11
Show Gist options
  • Save agusrichard/e7b4e9c502259b1311103d81122f51dd to your computer and use it in GitHub Desktop.
Save agusrichard/e7b4e9c502259b1311103d81122f51dd to your computer and use it in GitHub Desktop.
version: "3"
services:
server:
build:
context: .
dockerfile: Dockerfile
container_name: server
image: server
restart: always
volumes:
- /usr/app/node_modules
- ./src:/usr/app/src
- ./build:/usr/app/build
networks:
- app-network
ports:
- "5000:5000"
db:
image: postgres
ports:
- "5432:5432"
container_name: db
env_file:
- ".env"
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_NAME}
volumes:
- db-volume:/var/lib/postgresql/data
networks:
app-network:
driver: bridge
volumes:
db-volume:
driver: local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment