-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
74 lines (74 loc) · 2.11 KB
/
Copy pathdocker-compose.yml
File metadata and controls
74 lines (74 loc) · 2.11 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
services:
preflight:
image: debian:${DEBIAN_VERSION}
container_name: ${APP_NAME}-preflight
command:
- /bin/bash
- '-c'
- |
find /preflight \( -name '*.sh' -o -name '*.env' -o -name 'crontab.*' \) -exec sed -i -e 's/\r//g' {} \;
chmod +x /preflight/bin/run-script.sh
volumes:
- ./bin/:/preflight/bin
- ./config:/preflight/config
- ./cron:/preflight/cron
- ./scripts:/preflight/scripts
cron:
image: debian:${DEBIAN_VERSION}
container_name: ${APP_NAME}-cron
restart: unless-stopped
command:
- /bin/bash
- '-c'
- |
export DEBIAN_FRONTEND=noninteractive
export TARGET_DIR=$${CRON_DIR}
export ENV_FILE_PATTERN=/config/epg.env
export APT_CORE_PACKAGES="sudo ca-certificates curl gnupg"
export APT_PACKAGES="cron git"
export X_USER=$$CRON_USER
# run initialization
run-script.sh timezone apt adduser apt-install genenv nodejs cron cleanlock setowner +viewlog
# start cron
echo "Starting cron..."
cron -f -L 15
environment:
APP_TIMEZONE: ${APP_TIMEZONE}
APP_GUIDES_DIR: ${APP_GUIDES_DIR}
APT_MIRROR: ${APT_MIRROR}
NODE_VERSION: ${NODE_VERSION}
CRON_DIR: /cron
CRON_USER: epg
volumes:
- ./bin/run-script.sh:/usr/local/bin/run-script.sh
- ./scripts:/scripts
- ./build:/build
- ./config:/config
- ./cron:/cron
depends_on:
preflight:
condition: service_completed_successfully
nginx:
image: nginx
container_name: ${APP_NAME}-web
restart: unless-stopped
command:
- /bin/bash
- '-c'
- |
# run initialization
run-script.sh timezone
# run entrypoint
/docker-entrypoint.sh nginx -g "daemon off;"
ports:
- ${APP_HTTP_PORT}:80
environment:
APP_TIMEZONE: ${APP_TIMEZONE}
APP_GUIDES_DIR: ${APP_GUIDES_DIR}
volumes:
- ./bin/run-script.sh:/usr/local/bin/run-script.sh
- ./scripts:/scripts
- ./build:/build
- ./templates:/etc/nginx/templates
depends_on:
- cron