generated from CodeForBaltimore/ProjectTemplate
-
Notifications
You must be signed in to change notification settings - Fork 21
/
docker-compose.yaml
52 lines (52 loc) · 1.48 KB
/
docker-compose.yaml
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
version: "3"
services:
web:
build: .
depends_on:
- api
ports:
- ${PORT:-3000}:${PORT:-3000}
expose:
- ${PORT:-3000}
volumes:
- ./src:/usr/src/src
- ./__tests__:/usr/src/__tests__
- ./babel.config.js:/usr/src/babel.config.js
- ./jest.config.js:/usr/src/jest.config.js
- ./jest.init.js:/usr/src/jest.init.js
- ./__mocks__:/usr/src/__mocks__
env_file: .env
environment:
- ${PORT:-3000}
api:
build:
context: https://github.com/CodeForBaltimore/Bmore-Responsive.git#${API_TAG:-master}
depends_on:
- db
ports:
- ${API_PORT:-3001}:3001
expose:
- ${API_PORT:-3001}
command: >
sh -c "npm run db-delete &&
npm run db-create &&
npm run db-seed &&
npm start"
environment:
- 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}