/
docker-compose.yml
56 lines (51 loc) · 1.2 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
version: "3"
services:
# Database container.
mariadb:
image: mariadb:latest
container_name: mariadb
hostname: mariadb
command: --default-authentication-plugin=mysql_native_password
restart: unless-stopped
env_file: .env
volumes:
- db-data:/var/lib/mysql
- ./app-settings/mysql-conf/overrides.cnf:/etc/mysql/conf.d/overrides.cnf
networks:
- internal
# App itself.
app:
image: ghcr.io/nikro/docker-compose-template-app:main # Use your Dockerized app image.
container_name: app
hostname: app
depends_on:
- mariadb
restart: unless-stopped
env_file: .env
ports:
- "127.0.0.1:8081:8080"
environment:
MARIADB_HOST: mariadb
networks:
- internal
- external
volumes:
- app-code:/var/www/html
- app-data:/var/www/html/files
- ./app.log:/var/log/syslog
# There are 2 networks: external and internal.
networks:
external:
driver: bridge
internal:
driver: bridge
# Some volumes just exist as they are, others are mapped to localhost folders.
volumes:
app-code:
app-data:
driver: local
driver_opts:
o: bind
type: none
device: $PWD/app-data
db-data: