-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
104 lines (93 loc) · 2.59 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
version: "3.9"
services:
# Bot API service
bot-api:
environment:
TELEGRAM_WEB_APP_URL: https://${NGROK_DOMAIN}
TELEGRAM_BOT_TOKEN: ${TELEGRAM_BOT_TOKEN}
TELEGRAM_PAYMENTS_TOKEN: ${TELEGRAM_PAYMENTS_TOKEN}
JWT_SECRET: ${JWT_SECRET}
DB_CONNECTION_STRING: postgres://guide:guide@postgres-db:5432/guide-system?sslmode=disable
S3_CONNECTION_STRING: s3://guide:guide@s3-mock:7480/guide-objects?ssl=false
restart: on-failure
build:
context: ./api
# PostgreSQL DB
postgres-db:
image: postgres
volumes:
- guide-pg-db:/var/lib/postgresql/data
environment:
POSTGRES_USER: guide
POSTGRES_PASSWORD: guide
POSTGRES_DB: guide-system
restart: on-failure
# SQL migrations with go-migrate
db-migrator:
image: migrate/migrate
command: -path=/migrations/ -database postgres://guide:guide@postgres-db:5432/guide-system?sslmode=disable up
volumes:
- ./api/provider/db/migrations/postgres:/migrations
restart: on-failure
# UI for PostgreSQL DB
postgres-admin:
image: dpage/pgadmin4
volumes:
- guide-pg-admin:/var/lib/pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: admin@pgadmin.org
PGADMIN_DEFAULT_PASSWORD: admin
restart: on-failure
ports:
- 8100:80
# Mocked S3 server
s3-mock:
image: quay.io/s3gw/s3gw
volumes:
- guide-s3:/data
environment:
RGW_DEFAULT_USER_ACCESS_KEY: guide
RGW_DEFAULT_USER_SECRET_KEY: guide
restart: on-failure
# UI for S3 server
s3-ui:
image: quay.io/s3gw/s3gw-ui
environment:
S3GW_SERVICE_URL: http://s3-mock:7480
restart: on-failure
ports:
- 8200:8080
# Bot UI in development mode
bot-ui:
environment:
REACT_APP_BOT_API_URL: https://${NGROK_DOMAIN}/api
restart: on-failure
volumes:
- ./ui/src:/app/src
- ./ui/public:/app/public
- ./ui/index.html:/app/index.html
- ./ui/vite.config.js:/app/vite.config.js
build:
context: ./ui
dockerfile: dev.dockerfile
# Nginx proxy to forward request to UI and API
dev-proxy:
image: nginx:stable-alpine
environment:
PORT: 3000
API_URL: http://bot-api:3000
UI_URL: http://bot-ui:3000
restart: on-failure
volumes:
- ./proxy.template:/etc/nginx/templates/default.conf.template
# Ngrok service
ngrok:
image: ngrok/ngrok:alpine
environment:
NGROK_AUTHTOKEN: ${NGROK_AUTHTOKEN}
restart: on-failure
command: ["http", "--domain=${NGROK_DOMAIN}", "dev-proxy:3000", "--log=stdout"]
volumes:
guide-s3:
guide-pg-db:
guide-pg-admin: