forked from WWBN/AVideo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
189 lines (182 loc) · 5.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
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
version: '3'
services:
avideo:
build:
context: .
args:
SOCKET_PORT: ${SOCKET_PORT}
HTTP_PORT: ${HTTP_PORT}
HTTPS_PORT: ${HTTPS_PORT}
DB_MYSQL_HOST: ${DB_MYSQL_HOST}
DB_MYSQL_PORT: ${DB_MYSQL_PORT}
DB_MYSQL_NAME: ${DB_MYSQL_NAME}
DB_MYSQL_USER: ${DB_MYSQL_USER}
DB_MYSQL_PASSWORD: ${DB_MYSQL_PASSWORD}
SERVER_NAME: ${SERVER_NAME}
ENABLE_PHPMYADMIN: ${ENABLE_PHPMYADMIN}
PHPMYADMIN_PORT: ${PHPMYADMIN_PORT}
PHPMYADMIN_ENCODER_PORT: ${PHPMYADMIN_ENCODER_PORT}
CREATE_TLS_CERTIFICATE: ${CREATE_TLS_CERTIFICATE}
TLS_CERTIFICATE_FILE: ${TLS_CERTIFICATE_FILE}
TLS_CERTIFICATE_KEY: ${TLS_CERTIFICATE_KEY}
CONTACT_EMAIL: ${CONTACT_EMAIL}
SYSTEM_ADMIN_PASSWORD: ${SYSTEM_ADMIN_PASSWORD}
WEBSITE_TITLE: ${WEBSITE_TITLE}
MAIN_LANGUAGE: ${MAIN_LANGUAGE}
restart: "unless-stopped"
environment:
SOCKET_PORT: ${SOCKET_PORT:-2053}
HTTP_PORT: ${HTTP_PORT:-80}
HTTPS_PORT: ${HTTP_PORT:-443}
DB_MYSQL_HOST: "${DB_MYSQL_HOST:-database}"
DB_MYSQL_PORT: ${DB_MYSQL_PORT:-3306}
DB_MYSQL_NAME: "${DB_MYSQL_NAME:-avideo}"
DB_MYSQL_USER: "${DB_MYSQL_USER:-avideo}"
DB_MYSQL_PASSWORD: "${DB_MYSQL_PASSWORD:-avideo}"
SERVER_NAME: "${SERVER_NAME:-localhost}"
ENABLE_PHPMYADMIN: "${ENABLE_PHPMYADMIN:-yes}"
PHPMYADMIN_PORT: ${PHPMYADMIN_PORT:-8081}
PHPMYADMIN_ENCODER_PORT: ${PHPMYADMIN_ENCODER_PORT:-8082}
CREATE_TLS_CERTIFICATE: "${CREATE_TLS_CERTIFICATE:-yes}"
TLS_CERTIFICATE_FILE: "${TLS_CERTIFICATE_FILE:-/etc/apache2/ssl/localhost.crt}"
TLS_CERTIFICATE_KEY: "${TLS_CERTIFICATE_KEY:-/etc/apache2/ssl/localhost.key}"
CONTACT_EMAIL: "${CONTACT_EMAIL:-admin@localhost}"
SYSTEM_ADMIN_PASSWORD: "${SYSTEM_ADMIN_PASSWORD:-password}"
WEBSITE_TITLE: "${WEBSITE_TITLE:-AVideo}"
MAIN_LANGUAGE: "${MAIN_LANGUAGE:-en_US}"
NGINX_RTMP_PORT: "${NGINX_RTMP_PORT:-1935}"
NGINX_HTTP_PORT: "${NGINX_HTTP_PORT:-8080}"
NGINX_HTTPS_PORT: "${NGINX_HTTPS_PORT:-8443}"
env_file:
- .env
ports:
- "${SOCKET_PORT:-2053}:2053"
- "${HTTP_PORT:-80}:80"
- "${HTTPS_PORT:-443}:443"
volumes:
- "./.compose/tmp:/var/www/tmp"
- "./.compose/HLS:/HLS"
- "./:/var/www/html/AVideo"
- "./.compose/videos:/var/www/html/AVideo/videos"
- "./.compose/encoder:/var/www/html/AVideo/Encoder"
- "./.compose/letsencrypt:/etc/letsencrypt/"
depends_on:
database:
condition: service_healthy
database_encoder:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl --silent --fail http://localhost || exit 1"]
interval: 30s
timeout: 10s
retries: 3
networks:
- app_net
live:
build:
context: .
dockerfile: Dockerfile.live
restart: "unless-stopped"
volumes:
- "./.compose/tmp:/var/www/tmp"
- "./.compose/HLS:/HLS"
- "./.compose/letsencrypt:/etc/letsencrypt/"
environment:
SERVER_NAME: "${SERVER_NAME:-localhost}"
CREATE_TLS_CERTIFICATE: "${CREATE_TLS_CERTIFICATE:-yes}"
TLS_CERTIFICATE_FILE: "${TLS_CERTIFICATE_FILE:-/etc/apache2/ssl/localhost.crt}"
TLS_CERTIFICATE_KEY: "${TLS_CERTIFICATE_KEY:-/etc/apache2/ssl/localhost.key}"
NGINX_RTMP_PORT: "${NGINX_RTMP_PORT:-1935}"
NGINX_HTTP_PORT: "${NGINX_HTTP_PORT:-8080}"
NGINX_HTTPS_PORT: "${NGINX_HTTPS_PORT:-8443}"
env_file:
- .env
ports:
- "${NGINX_RTMP_PORT:-1935}:1935"
- "${NGINX_HTTP_PORT:-8080}:8080"
- "${NGINX_HTTPS_PORT:-8443}:8443"
depends_on:
avideo:
condition: service_healthy
database:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl --silent --fail http://localhost:8080 || exit 1"]
interval: 30s
timeout: 10s
retries: 3
networks:
- app_net
database:
image: "mariadb:latest"
restart: "unless-stopped"
environment:
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
MYSQL_INITDB_SKIP_TZINFO: 1
MYSQL_DATABASE: "${DB_MYSQL_NAME}"
MYSQL_USER: "${DB_MYSQL_USER}"
MYSQL_PASSWORD: "${DB_MYSQL_PASSWORD}"
volumes:
- ./.compose/db:/var/lib/mysql
healthcheck:
#test: ["CMD-SHELL", "mysqladmin ping -h localhost -u root -pexample"]
test: "mariadb-admin ping -h localhost -u $MYSQL_USER -p$MYSQL_PASSWORD"
interval: 30s
timeout: 10s
retries: 3
networks:
- app_net
database_encoder:
image: "mariadb:latest"
restart: "unless-stopped"
environment:
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
MYSQL_INITDB_SKIP_TZINFO: 1
MYSQL_DATABASE: "${DB_MYSQL_NAME}_encoder"
MYSQL_USER: "${DB_MYSQL_USER}"
MYSQL_PASSWORD: "${DB_MYSQL_PASSWORD}"
volumes:
- ./.compose/db_encoder:/var/lib/mysql
healthcheck:
#test: ["CMD-SHELL", "mysqladmin ping -h localhost -u root -pexample"]
test: "mariadb-admin ping -h localhost -u $MYSQL_USER -p$MYSQL_PASSWORD"
interval: 30s
timeout: 10s
retries: 3
networks:
- app_net
#http://localhost:8081
phpmyadmin:
image: "phpmyadmin/phpmyadmin"
restart: "unless-stopped"
environment:
PMA_HOST: "${DB_MYSQL_HOST}"
PMA_PORT: ${DB_MYSQL_PORT}
PMA_CONTROLUSER: "${DB_MYSQL_USER}"
PMA_CONTROLPASS: "${DB_MYSQL_PASSWORD}"
HIDE_PHP_VERSION: "true"
ports:
- "${PHPMYADMIN_PORT:-8081}:80"
depends_on:
- database
networks:
- app_net
#http://localhost:8082
phpmyadmin_encoder:
image: "phpmyadmin/phpmyadmin"
restart: "unless-stopped"
environment:
PMA_HOST: "${DB_MYSQL_HOST}_encoder"
PMA_PORT: ${DB_MYSQL_PORT}
PMA_CONTROLUSER: "${DB_MYSQL_USER}"
PMA_CONTROLPASS: "${DB_MYSQL_PASSWORD}"
HIDE_PHP_VERSION: "true"
ports:
- "${PHPMYADMIN_ENCODER_PORT:-8082}:80"
depends_on:
- database_encoder
networks:
- app_net
networks:
app_net:
driver: bridge