-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
121 lines (107 loc) · 2.74 KB
/
docker-compose.yml
File metadata and controls
121 lines (107 loc) · 2.74 KB
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
version: "3.7"
# chcp.com 437
services:
############### POSTGRES ################
# Access to postgres:
# localhost:5432
# Access to PgAdmin:
# URL: http://localhost:5002
# Add a new server inn PgAdmin:
# Host name/address postgres
# Port 5432
# Multiple scripts (in volumes) run in alphabetical order,
# thus it's good practice to prefix them with a number.
alertsDb:
container_name: alertsDb
image: postgres:12.1-alpine
volumes:
- postgres:/var/lib/postgresql/data/
- ./api/src/app/db/init.sql:/docker-entrypoint-initdb.d/init.sql
# - .api/src/app/db/schema.sql:/docker-entrypoint-initdb.d/1-schema.sql
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
ports:
- "5432:5432"
networks:
- postgres
restart: unless-stopped
# depends_on:
# - nginx
# # ############ PGADMIN ###################
pgadmin:
container_name: pgadmin
image: dpage/pgadmin4
environment:
- PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL}
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD}
# - PGADMIN_LISTEN_PORT=${PGADMIN_LISTEN_PORT}
volumes:
- pgadmin:/var/lib/pgadmin
ports:
- "${PGADMIN_PORT}:82"
networks:
- postgres
restart: unless-stopped
logging:
driver: none
depends_on:
# - nginx
- alertsDb
api:
container_name: api
build: ./api/src
command: gunicorn -w 4 -k uvicorn.workers.UvicornWorker main:app --bind 0.0.0.0 --log-level info --access-logfile - --reload
ports:
- "${API_PORT}:${API_PORT}"
volumes:
- ./api/src/:/usr/src/
restart: unless-stopped
environment:
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@alertsDb/alertsDb
networks:
- postgres
- api2api
# - proxy
depends_on:
# - nginx
- alertsDb
bot:
container_name: tgBot
build: ./tgBot/src
command: python3 /usr/src/app/main.py
environment:
- TG_API_KEY=${TG_API_KEY}
- ALERT_API_TOKEN=${ALERT_API_TOKEN}
- ALERT_API_BASE_URL=${ALERT_API_BASE_URL}
- IS_DOCKER=True
volumes:
- ./tgBot/src/:/usr/src/
# - "/codebase:/codebase"
# - "/storage:/storage"
restart: always
networks:
- api2api
# nginx:
# image: 'jc21/nginx-proxy-manager:latest'
# restart: unless-stopped
# ports:
# - '80:80'
# - '81:81'
# - '443:443'
# volumes:
# - ./nginx/src/data:/data
# - ./nginx/src/letsencrypt:/etc/letsencrypt
# networks:
# - proxy
networks:
# proxy:
# name: proxy
postgres:
driver: bridge
api2api:
driver: bridge
volumes:
postgres:
pgadmin: