generated from CodeForBaltimore/ProjectTemplate
-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
36 lines (36 loc) · 1.06 KB
/
docker-compose.yml
File metadata and controls
36 lines (36 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
version: "3"
services:
api:
build: .
depends_on:
- db
ports:
- ${PORT:-3001}:${PORT:-3001}
expose:
- ${PORT:-3001}
volumes:
- ./src:/usr/src/src
command: >
sh -c "npm run db-delete &&
npm run db-create &&
npm run db-seed &&
npm start"
environment:
- PORT=${PORT:-3001}
- NODE_ENV=${NODE_ENV:-development}
- BYPASS_LOGIN=${BYPASS_LOGIN:-true}
- DATABASE_HOST=${DATABASE_HOST:-db}
- DATABASE_PORT=${DATABASE_PORT:-5432}
- DATABASE_NAME=${DATABASE_NAME:-postgres}
- DATABASE_SCHEMA=${DATABASE_SCHEMA:-public}
- DATABASE_USERNAME=${DATABASE_USERNAME:-postgres}
- JWT_KEY=${JWT_KEY:?JWT_KEY must be set}
- DATABASE_PASSWORD=${DATABASE_PASSWORD:?DATABASE_PASSWORD must be set}
db:
image: postgres
restart: always
expose:
- 5432
environment:
- POSTGRES_USER=${DATABASE_USERNAME:-postgres}
- POSTGRES_PASSWORD=${DATABASE_PASSWORD:?DATABASE_PASSWORD must be set}