-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
94 lines (89 loc) · 2.01 KB
/
docker-compose.yml
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
version: '2.4'
services:
# Mongo DB server
mongo:
image: mongo
restart: always
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongo localhost:27017/test --quiet
volumes:
- mongo_vol:/data/db
networks:
- lethe-network
# Development server
dev:
image: letheapi_dev
build:
context: .
target: dev
depends_on:
mongo:
condition: service_healthy
volumes:
- .:/app:delegated
- node_modules:/app/node_modules
environment:
- NODE_ENV=development
- SL_APOLLO_ENGINE_API_KEY=${SL_APOLLO_ENGINE_API_KEY}
- SL_DATABASE_URL='${SL_DATABASE_URL}'
- PORT=${PORT}
ports:
- '8080:9999'
command: yarn dev
networks:
- lethe-network
labels:
- traefik.http.routers.develop.rule=Host(`develop.localhost`)
# Reverse Proxy
traefik:
image: traefik:2.1
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- '80:80'
command:
- --api.insecure
- --entrypoints.web.address=:80
- --providers.docker
labels:
- traefik.http.routers.traefik.rule=Host(`traefik.localhost`)
- traefik.http.services.traefik.loadbalancer.server.port=8080
networks:
- lethe-network
# Development tests
test:
image: letheapi_test
build:
context: .
target: test
depends_on:
mongo:
condition: service_healthy
volumes:
- .:/app:delegated
- node_modules:/app/node_modules
environment:
- TEST=true
- SL_DATABASE_URL='mongodb://mongo:27017/test'
networks:
- lethe-network
# CI tests
test_ci:
image: test_ci:latest
build:
context: .
target: ci
depends_on:
mongo:
condition: service_healthy
environment:
- TEST=true
- SL_DATABASE_URL='mongodb://mongo:27017/test'
- SL_APOLLO_ENGINE_API_KEY=${SL_APOLLO_ENGINE_API_KEY}
networks:
- lethe-network
volumes:
mongo_vol:
node_modules:
networks:
lethe-network: