-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
80 lines (79 loc) · 1.73 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
version: '3.8'
services:
api:
restart: always
depends_on:
- mysql
container_name: api
image: lefantan/portfoliov2-backend
build:
context: ./api
dockerfile: Dockerfile
volumes:
- ./api:/app
ports:
#first 3000 is the port exposed on host, the second one is port exposed to other docker containers
- "3000:3001"
environment:
GOOGLE_APPLICATION_CREDENTIALS: service-account.json
test_api:
depends_on:
- mysql
# interactive shell that allows colored output
tty: true
container_name: test_api
image: lefantan/portfoliov2-backend
command:
[sh, -c, "npm run test"]
volumes:
- ./api:/app
build:
context: ./api
dockerfile: Dockerfile.test
ports:
- "3002:3002"
environment:
GOOGLE_APPLICATION_CREDENTIALS: service-account.json
PORT: 3002
DB_LOGGING: "false"
NODE_ENV: test
DB_NAME: test
client:
restart: always
container_name: client
image: lefantan/portfoliov2-backend_client
build:
context: ./client
dockerfile: Dockerfile
volumes:
- ./client:/app
expose:
[5000]
nginx:
restart: always
container_name: nginx
depends_on:
- api
- client
build:
context: ./nginx
dockerfile: Dockerfile
ports:
- "443:443"
- "80:80"
mysql:
image: mysql:8.0.27
container_name: mysql
volumes:
# persist data
- ./temp_data:/var/lib/mysql
# init test db
- ./test-db.sql:/docker-entrypoint-initdb.d/test-db.sql
restart: always
cap_add:
- SYS_NICE
environment:
MYSQL_ROOT_PASSWORD: admin
MYSQL_DATABASE: portfolio
ports:
- "3306:3306"