-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
119 lines (108 loc) · 2.8 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
version: '3.8'
services:
mongodb:
image: mongo:latest
container_name: mongodb
volumes:
- /data/test-change-streams:/data/db
ports:
- "27017:27017"
networks:
- app-network
command: mongod --replSet test-change-streams --logpath /data/db/mongodb.log --dbpath /data/db --port 27017
mongodb-setup:
image: mongo:latest
depends_on:
- mongodb
networks:
- app-network
command: >
bash -c "
sleep 10 &&
mongosh --host mongodb:27017 --eval \"
rs.initiate({
_id: 'test-change-streams',
members: [
{_id: 0, host: 'mongodb:27017'}
]
})
\"
"
fastapi-app:
image: multilanguage_invoice_ocr-fastapi-app
build:
context: .
dockerfile: Dockerfile
container_name: fastapi-app
environment:
- OPENAI_API_KEY=${OPENAI_API_KEY}
- EMAIL_USER=${EMAIL_USER}
- EMAIL_PASSWORD=${EMAIL_PASSWORD}
- USERNAME=${USERNAME}
- PASSWORD=${PASSWORD}
- SECRET_KEY=${SECRET_KEY}
- ALGORITHM=${ALGORITHM}
- ACCESS_TOKEN_EXPIRE_MINUTES=${ACCESS_TOKEN_EXPIRE_MINUTES}
- SERVER_IP=${SERVER_IP}
volumes:
- ./config:/app/config
- ./src:/app/src
ports:
- "8149:8149"
networks:
- app-network
depends_on:
- mongodb
- mongodb-setup
jwt-frontend:
image: multilanguage_invoice_ocr-jwt-frontend
build:
context: ./jwt-auth-frontend
dockerfile: Dockerfile
container_name: jwt-frontend
volumes:
- ./jwt-auth-frontend/src:/app/src
ports:
- "3000:3000"
networks:
- app-network
depends_on:
- fastapi-app
environment:
- REACT_APP_SERVER_IP=${SERVER_IP}
nginx:
build:
context: ./nginx
container_name: nginx
volumes:
# Remove the dynamic path in volume mounting
- ./nginx/dev/nginx.conf.template:/etc/nginx/dev/nginx.conf.template:ro
- ./nginx/prod/nginx.conf.template:/etc/nginx/prod/nginx.conf.template:ro
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
ports:
- "80:80"
- "443:443"
networks:
- app-network
depends_on:
- fastapi-app
- jwt-frontend
- mongodb
environment:
- CLIENT_MAX_BODY_SIZE=${CLIENT_MAX_BODY_SIZE}
- SERVER_IP=${SERVER_IP}
- DEBUG=${DEBUG:-false}
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
certbot:
image: certbot/certbot
container_name: certbot
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
networks:
- app-network
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
networks:
app-network:
driver: bridge