-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yml
66 lines (63 loc) · 1.71 KB
/
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
version: "3"
# Define services/containers
services:
# web server
php-apache:
# Use php:8-apache image from Dockerfile
image: ${APP_NAME}-web
build:
context: ./src
dockerfile: Dockerfile
# Connect to "my-network" network
networks:
- my-network
ports:
- "80:80"
# Depends on "mysql" network to find mysql
links:
- "mysql"
environment:
ENVIRONMENT: ${ENVIRONMENT}
volumes:
- ./src:/var/www/html
# MySQL container
# Changed to mariadb, however keep the names
mysql:
# Use mysql:lstest image from mysql/Dockerfile
image: $APP_NAME-db
build:
context: ./mysql
dockerfile: Dockerfile
# Connect to "my-network" network, as defined below
networks:
- my-network
# Pass a list of environment variables to the container
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
# Create presistence in mysql
# volumes:
# - ./mysql/volume:/var/lib/mysql
# - /home/docker/persistence/mysql:/var/lib/mysql
command: ['mysqld', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci']
# phpMyAdmin container
phpmyadmin:
# Use phpmyadmin/phpmyadmin:5.0.2 image
image: phpmyadmin/phpmyadmin:latest
# Connect to "my-network" network, as defined below
networks:
- my-network
# Map port 8080 on the host to port 80 inside the container
# Syntax is: "HOST_PORT:CONTAINER_PORT"
ports:
- "8080:80"
# Pass a list of environment variables to the container
environment:
PMA_HOST: mysql
# Wait for "mysql" container to start first
depends_on:
- mysql
# Define networks
networks:
my-network: