Skip to content

Instantly share code, notes, and snippets.

@fhsinchy
Created July 27, 2021 08:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fhsinchy/26a78ad31d9f4b252ec01ec3c153ae56 to your computer and use it in GitHub Desktop.
Save fhsinchy/26a78ad31d9f4b252ec01ec3c153ae56 to your computer and use it in GitHub Desktop.
## /notes-api/docker-compose.yaml
version: "3.8"
services:
db:
image: postgres:12
volumes:
- db-data:/var/lib/postgresql/data
environment:
POSTGRES_DB: notesdb
POSTGRES_PASSWORD: secret
api:
build:
context: ./api
command: [ "./node_modules/.bin/nodemon", "--config", "nodemon.json", "bin/www" ]
environment:
NODE_ENV: development
DB_HOST: db ## same as the database service name
DB_DATABASE: notesdb
DB_PASSWORD: secret
volumes:
- /home/node/app/node_modules
- ./api:/home/node/app
ports:
- 3000:3000
volumes:
db-data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment