-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcompose.yml
122 lines (117 loc) · 3.33 KB
/
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
120
121
122
version: "3.9"
services:
redis:
image: redis:7.0
restart: unless-stopped
env_file: .env
volumes:
- ${DATA_PATH}/redis:/data
ports:
- 6379:6379
command: bash -c "redis-server --requirepass ${REDIS_PASS}"
db:
image: mongo:6.0
ports:
- 27017:27017
restart: unless-stopped
env_file: .env
environment:
MONGO_INITDB_DATABASE: admin
MONGO_INITDB_ROOT_USERNAME: ${MONGO_USER}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASS}
volumes:
- ${DATA_PATH}/db:/data/db
- ${DATA_PATH}/logs/mongodb.log:/data/logs/mongodb.log
- ./configs/mongod.conf:/etc/mongod.conf
command: --config /etc/mongod.conf
api:
image: ${PROJECT_NAME}/api
build: ./api
depends_on:
- db
- redis
restart: unless-stopped
env_file: .env
environment:
WEB: http://localhost/
volumes:
- ${DATA_PATH}/load:/data/load
- ${DATA_PATH}/backup:/backup
- ./scripts:/app/scripts
# # For logs
# - ${DATA_PATH}/logs/api.err:/app/app.err
# - ${DATA_PATH}/logs/api.log:/app/app.log
# For hot reload
- ./api:/app
command: bash -c "cd /app && uvicorn app:app --host 0.0.0.0 --port 5000 --proxy-headers --reload"
# healthcheck:
# test: "curl --fail http://0.0.0.0:5000/"
# interval: 1s
# timeout: 1s
# start_period: 180s
# retries: 180
# jobs:
# image: ${PROJECT_NAME}/jobs
# build: ./api
# depends_on:
# - db
# - redis
# restart: unless-stopped
# env_file: .env
# environment:
# API: http://api:5000/
# WEB: http://localhost/
# volumes:
# # For logs
# - ${DATA_PATH}/logs/jobs.err:/app/app.err
# - ${DATA_PATH}/logs/jobs.log:/app/app.log
# # For hot reload
# - ./api:/app
# # For sitemap
# - ${DATA_PATH}/sitemaps:/data/sitemaps
# - ${DATA_PATH}/sitemap.xml:/data/sitemap.xml
# - ${DATA_PATH}/robots.txt:/data/robots.txt
# command: bash -c "cd /app && python job.py"
web:
image: ${PROJECT_NAME}/web
build: ./web
restart: unless-stopped
env_file: .env
environment:
NEXT_PUBLIC_API: http://localhost/api/
NEXT_PUBLIC_WEB: http://localhost/
NEXT_PUBLIC_NAME: ${NAME}
NEXT_PUBLIC_LOCALE: ${LOCALE}
NEXT_PUBLIC_GOOGLE_ID: ${GOOGLE_ID}
NEXT_PUBLIC_VK_ID: ${VK_ID}
NEXT_PUBLIC_GOOGLE_MAPS_KEY: ${GOOGLE_MAPS_KEY}
NEXT_PUBLIC_GOOGLE_MAPS_LAT: ${GOOGLE_MAPS_LAT}
NEXT_PUBLIC_GOOGLE_MAPS_LNG: ${GOOGLE_MAPS_LNG}
NEXT_PUBLIC_GOOGLE_MAPS_ZOOM: ${GOOGLE_MAPS_ZOOM}
NEXT_PUBLIC_TG_BOT: ${TG_BOT}
NEXT_PUBLIC_ANALYTICS_SHEET: ${ANALYTICS_SHEET}
volumes:
- ./web/public:/app/public
- ./web/styles:/app/styles
- ./web/lib:/app/lib
- ./web/redux:/app/redux
- ./web/components:/app/components
- ./web/pages:/app/pages
command: npm run dev
server:
image: nginx:1.23
restart: unless-stopped
env_file: .env
volumes:
- ./configs/nginx.conf:/etc/nginx/nginx.conf
- ${DATA_PATH}/load:/load
- ${DATA_PATH}/logs:/data/logs
# For sitemap
- ${DATA_PATH}/sitemaps:/data/sitemaps
- ${DATA_PATH}/sitemap.xml:/data/sitemap.xml
- ${DATA_PATH}/robots.txt:/data/robots.txt
depends_on:
- api
- web
ports:
- ${EXTERNAL_PORT}:80