generated from nikelborm/project-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
131 lines (123 loc) · 4.05 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
120
121
122
123
124
125
126
127
128
129
130
131
version: '3.9'
services:
nginx-prod:
image: "${COMPOSE_PROJECT_NAME}-nginx-prod"
restart: always
depends_on:
- backend-prod
- postgres-admin-prod
build:
context: ./
dockerfile: ./frontend/Dockerfile
target: prod_nginx_with_front_static
args:
- REACT_APP_NAME=${COMPOSE_PROJECT_NAME}
environment:
- TZ=${TZ}
- GENERATE_SOURCEMAP=${GENERATE_SOURCEMAP}
- EXTERNAL_NGINX_HTTP_PORT=${EXTERNAL_NGINX_HTTP_PORT}
- INNER_BACKEND_HTTP_SERVER_PORT=${INNER_BACKEND_HTTP_SERVER_PORT}
- INNER_BACKEND_WS_SERVER_PORT=${INNER_BACKEND_WS_SERVER_PORT}
ports:
- ${EXTERNAL_NGINX_HTTP_PORT}:80/tcp
- ${EXTERNAL_NGINX_HTTPS_PORT}:443/tcp
networks:
nginx-back-net:
nginx-pgadmin-net:
# external-net:
# ipv4_address: 192.168.55.10
# volumes:
# - ./data/certbot/conf:/etc/letsencrypt
# - ./data/certbot/www:/var/www/certbot
# certbot:
# image: certbot/certbot
# command: certonly -n -d local.host --webroot --agree-tos --email kolya007.klass@gmail.com -w /var/www/certbot
# volumes:
# - ./data/certbot/conf:/etc/letsencrypt
# - ./data/certbot/www:/var/www/certbot
# - ./data/certbot/logs:/var/log/letsencrypt/
backend-prod:
image: "${COMPOSE_PROJECT_NAME}-backend-prod"
restart: always
depends_on:
- postgres-prod
build:
context: ./backend/
target: production
args:
- INNER_BACKEND_HTTP_SERVER_PORT=${INNER_BACKEND_HTTP_SERVER_PORT}
- INNER_BACKEND_WS_SERVER_PORT=${INNER_BACKEND_WS_SERVER_PORT}
environment:
- TZ=${TZ}
- NODE_ENV=production
- SERVER_PORT=${INNER_BACKEND_HTTP_SERVER_PORT}
- WEB_SOCKET_SERVER_PORT=${INNER_BACKEND_WS_SERVER_PORT}
- BOOTSTRAP_MODE=${BOOTSTRAP_MODE}
- MOCK_SCRIPT_NAME=${MOCK_SCRIPT_NAME}
- AUTH_JWT_SECRET=${AUTH_JWT_SECRET}
- USER_PRIVATE_KEY_HASH_SALT=${USER_PRIVATE_KEY_HASH_SALT}
- INVITE_USERS_SIGN_KEY=${INVITE_USERS_SIGN_KEY}
- DATABASE_HOST=${DATABASE_HOST}
- DATABASE_PORT=${DATABASE_PORT}
- DATABASE_USERNAME=${DATABASE_USERNAME}
- DATABASE_PASSWORD=${DATABASE_PASSWORD}
- DATABASE_NAME=${DATABASE_NAME}
- DATABASE_TYPEORM_LOGGING_MODE=${DATABASE_TYPEORM_LOGGING_MODE}
- ROOT_WALLET_PRIVATE_KEY=${ROOT_WALLET_PRIVATE_KEY}
- ROOT_WALLET_PUBLIC_KEY=${ROOT_WALLET_PUBLIC_KEY}
- BLOCKCHAIN_BASE_URL=${BLOCKCHAIN_BASE_URL}
volumes:
- type: bind
source: ./backend/src/modules/infrastructure/
target: /app/src/modules/infrastructure/
networks:
nginx-back-net:
back-db-net:
postgres-prod:
image: postgres
restart: always
command: "-c default_text_search_config=pg_catalog.russian"
environment:
- TZ=${TZ}
- POSTGRES_PASSWORD=${DATABASE_PASSWORD}
- POSTGRES_USER=${DATABASE_USERNAME}
- POSTGRES_DB=${DATABASE_NAME}
volumes:
- type: volume
source: postgres-prod-data
target: /var/lib/postgresql/data
networks:
back-db-net:
db-pgadmin-net:
postgres-admin-prod:
image: dpage/pgadmin4:latest
restart: always
depends_on:
- postgres-prod
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
networks:
nginx-pgadmin-net:
db-pgadmin-net:
volumes:
postgres-prod-data:
# when i will really want to use https and ssl
# article how to setup certbot and let's encrypt
# https://pentacent.medium.com/nginx-and-lets-encrypt-with-docker-in-less-than-5-minutes-b4b8a60d3a71
# online nginx configuration
# https://www.digitalocean.com/community/tools/nginx
# TODO: research posibility to use serial device and run smarthouse
# https://www.losant.com/blog/how-to-access-serial-devices-in-docker
networks:
nginx-back-net: {}
back-db-net: {}
nginx-pgadmin-net: {}
db-pgadmin-net: {}
# external-net:
# driver: bridge
# ipam:
# driver: default
# config:
# - subnet: 192.168.55.0/24
# gateway: 192.168.55.1