-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
102 lines (95 loc) · 1.98 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
version: '3.8'
services:
# Nginx as a reverse proxy for Vue.js and FastAPI
nginx:
container_name: eza_web_prod
build:
context: ./nginx
environment:
VITE_API_SERVER: https://www.example.com/ezanalytics
ports:
- "8080:80"
- "4430:443"
depends_on:
- fastapi
- mongo
- postgres
- redis
networks:
- analytics_network
# FastAPI
fastapi:
container_name: eza_fastapi_prod
build:
context: ./api
working_dir: /app
environment:
ORIGINS: https://www.example.com/
MONGO_HOST: mongo
MONGO_USER: root
MONGO_PASSWORD: ezaMongoPass
PG_HOST: postgres
PG_USER: postgres
PG_PASSWORD: mypassword
REDIS_HOST: redis
ports:
- 5050:5050
volumes:
- ./api:/app
command: uvicorn app.main:app --proxy-headers --host 0.0.0.0 --port 5050
depends_on:
- postgres
- redis
- mongo
networks:
- analytics_network
# PostgreSQL
postgres:
container_name: eza_postgres_prod
build:
context: ./postgres
environment:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: mypassword
expose:
- "5432"
volumes:
- postgres-data:/data
networks:
- analytics_network
# Redis
redis:
container_name: eza_redis_prod
image: redis:latest
command: redis-server && redis-cli FLUSHALL
expose:
- "6379"
volumes:
- redis-data:/data
- redis-conf:/usr/local/etc/redis/redis.conf
networks:
- analytics_network
# MongoDB
mongo:
container_name: eza_mongo_prod
build:
context: ./mongodb
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: ezaMongoPass
expose:
- "27017"
volumes:
- mongo-data:/data
networks:
- analytics_network
networks:
analytics_network:
volumes:
ezanalytics-vue:
fastapi:
mongo-data:
postgres-data:
redis-data:
redis-conf: