-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
executable file
·74 lines (69 loc) · 2.03 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
version: '3.9'
networks:
lamp:
services:
server:
build:
context: .
dockerfile: ./docker/Dockerfile
args:
- PHP_VERSION_SELECTED=${PHP_VERSION_SELECTED:-8.2}
- PHP_VERSION=${PHP_VERSION_SELECTED:-8.2}
container_name: '${APP_NAME:-lamp_app}-server'
ports:
- '${APP_PORT:-881}:80'
- '${SSL_PORT:-4443}:443'
working_dir: /var/www/
environment:
- 'DATABASE_URL=mysql://${MYSQL_USER:-root}:${MYSQL_PASS:-root}@db_server:3306/${MYSQL_DB:-lamp_local_db}'
volumes:
- ./sources:/var/www/
- ./docker/server/apache/sites-enabled:/etc/apache2/sites-enabled
- ./docker/server/php/php.ini:/usr/local/etc/php/conf.d/extra-php-config.ini
- ./docker/server/php/php-xdebug.ini:/usr/local/etc/php/conf.d/zz-xdebug-settings.ini
- ./docker/server/certs:/var/www/certs
- ./docker/logs:/var/www/logs
networks:
- lamp
db_server:
image: mariadb
container_name: '${APP_NAME:-lamp_app}-db'
restart: always
ports:
- '${DB_PORT:-13306}:3306'
environment:
MYSQL_ROOT_PASSWORD: '${MYSQL_ROOT_PASS:-root}'
MYSQL_USER: '${MYSQL_USER:-root}'
MYSQL_PASSWORD: '${MYSQL_PASS:-root}'
MYSQL_DATABASE: '${MYSQL_DB:-lamp_local_db}'
volumes:
- db_data:/var/lib/mysql
- ./docker/db/mariadb/my.cnf:/etc/mysql/conf.d/my.cnf
healthcheck:
test: mysqladmin ping -h ${IP_DB_SERVER:-127.0.0.1} -u root --password=${MYSQL_ROOT_PASS:-root}
interval: 5s
retries: 5
networks:
- lamp
phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: ${APP_NAME:-lamp_app}-phpmyadmin
restart: always
ports:
- '${PHPMYADMIN_PORT:-9011}:${APP_PORT:-881}'
environment:
PMA_HOST: db_server
UPLOAD_LIMIT: ${PHPMYADMIN_UPLOAD_LIMIT:-1024M}
networks:
- lamp
redis:
image: redis
container_name: ${APP_NAME:-lamp_app}-redis
hostname: redis
restart: 'on-failure'
ports:
- '${REDIS_PORT:-16379}:6379'
networks:
- lamp
volumes:
db_data: