-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
106 lines (97 loc) · 3.01 KB
/
docker-compose.yml
File metadata and controls
106 lines (97 loc) · 3.01 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
# Re-usable volume definition for tng containers
#
x-tng-volumes: &tng-volumes
- "/etc/localtime:/etc/localtime:ro"
- data:${TNG_HTML_DIR:-/var/www/html}
- php_conf:/usr/local/etc/php
services:
# Basic image for using TNG. Does NOT have unpacked files and initial configuration!
tng:
container_name: tng
image: tng:latest
ports:
- ${TNG_PORT:-8888}:80
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-sL", "http://localhost/readme.html"]
interval: 30s
timeout: 10s
retries: 3
tty: true
stdin_open: true
volumes: *tng-volumes
depends_on:
tng_db:
condition: service_healthy
tng_init:
condition: service_completed_successfully
tng_init:
# Perform TNG file unpacking and initialization
image: tng:latest
container_name: tng_init
build:
context: .
dockerfile_inline: |
# Dockerfile for TNG Family Tree Web app
# - https://www.tngsitebuilding.com/
# - Pre-requisites: install your download of tng12.1 in the file where this Dockerfile resides
#
# Ideas for this Dockerfile were inspired by
# https://github.com/sprintcube/docker-compose-lamp/blob/master/bin/webserver/Dockerfile
FROM php:${PHP_VERSION:-8}-apache
COPY ${TNG_ZIP_FILE:-tngfiles1502.zip} ${TNG_HTML_DIR:-/var/www/html}/
COPY ./tng_init.sh ${TNG_HTML_DIR:-/var/www/html}
COPY ./.env ${TNG_HTML_DIR:-/var/www/html}
COPY ./mod[s] ${TNG_HTML_DIR:-/var/www/html}/${TNG_FOLDER_MODSPATH:-mods}
COPY ./patche[s] ${TNG_HTML_DIR:-/var/www/html}/patches
RUN docker-php-ext-install pdo_mysql
RUN docker-php-ext-install mysqli
RUN apt-get update -y && apt-get install -y unzip
RUN if [ ! -z "${XDEBUG_VERSION}" ]; then pecl install xdebug; fi
RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini
restart: no
command: [ "/bin/bash", "${TNG_HTML_DIR:-/var/www/html}/tng_init.sh" ]
tty: true
stdin_open: true
volumes: *tng-volumes
depends_on:
tng_db:
condition: service_healthy
tng_db:
image: mysql:latest
container_name: tng_db
restart: unless-stopped
env_file:
- .env
ports:
- ${TNG_DB_PORT:-3306}:3306
volumes:
- "/etc/localtime:/etc/localtime:ro"
- "/usr/share/zoneinfo:/usr/share/zoneinfo"
- db:/var/lib/mysql
healthcheck:
test: ["CMD", "mysql", "-u", "root", "-p${MYSQL_ROOT_PASSWORD}", "-e", "SELECT 1"]
interval: 10s
timeout: 5s
retries: 3
# phpmyadmin:
# image: phpmyadmin/phpmyadmin
# container_name: 'phpmyadmin'
# restart: unless-stopped
# links:
# - tng_db:db
# env_file:
# - .env
# environment:
# - PMA_HOST=tng_db
# - PMA_PORT=${TNG_DB_PORT:-3306}
# - PMA_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
# #- PMA_ARBITRARY=1
# ports:
# - ${PMA_WEB_PORT:-8080}:80
# depends_on:
# - tng_db
volumes:
db:
data:
php_conf: