-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yml
More file actions
132 lines (123 loc) · 3.69 KB
/
compose.yml
File metadata and controls
132 lines (123 loc) · 3.69 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
services:
nginx-dev:
image: nginx
profiles: ["dev"]
volumes:
- ./www/data:/usr/share/nginx/html/data
- ./www/v:/usr/share/nginx/html/v
- ./certs:/usr/share/nginx/certs
- ./nginx.conf:/etc/nginx/nginx.conf
- ./conf.d/dev:/etc/nginx/conf.d
ports:
- "80:80"
- "443:443"
restart: unless-stopped
depends_on:
- php-dev
stop_grace_period: 1s
networks:
- app-network
nginx-prod:
image: nginx
profiles: ["prod"]
volumes:
- ./www/data:/usr/share/nginx/html/data
- ./www/v:/usr/share/nginx/html/v
- ./vue-app/dist:/usr/share/nginx/html/dist
- ./certs:/usr/share/nginx/certs
- ./nginx.conf:/etc/nginx/nginx.conf
- ./conf.d/prod:/etc/nginx/conf.d
ports:
- "80:80"
- "443:443"
restart: unless-stopped
depends_on:
- php-prod
networks:
- app-network
php-build:
profiles: ["dev", "prod"]
build: ./conf_php
image: skilltech-php
volumes:
- ./certs:/certs
command: sh -c "if [ -e /certs/cert.crt ] && [ -e /certs/cert.key ]; then echo 'Certificate found'; else echo 'Generating self-signed certificate' && openssl req -x509 -newkey rsa:4096 -keyout /certs/cert.key -out /certs/cert.crt -sha256 -days 3650 -nodes -subj '/C=XX/ST=Luxembourg/CN=*'; fi"
php-prod:
image: skilltech-php
pull_policy: never
depends_on:
php-build:
condition: service_completed_successfully
profiles: ["prod"]
restart: unless-stopped
# stdin_open: true
# tty: true
expose:
- 9000
volumes:
- ./www:/usr/share/nginx/html
- ./src:/usr/share/nginx/src
- ./cache:/usr/share/nginx/cache
- ./conf_php/php.ini-production:/usr/local/etc/php/conf.d/php.ini
working_dir: /usr/share/nginx/php
networks:
- app-network
php-dev:
image: skilltech-php
pull_policy: never
depends_on:
php-build:
condition: service_completed_successfully
profiles: ["dev"]
restart: unless-stopped
# stdin_open: true
# tty: true
expose:
- 9000
volumes:
- ./www:/usr/share/nginx/html
- ./src:/usr/share/nginx/src
- ./cache:/usr/share/nginx/cache
- ./conf_php/php.ini-development:/usr/local/etc/php/conf.d/php.ini
working_dir: /usr/share/nginx/php
networks:
- app-network
mariadb:
image: mariadb:latest
profiles: ["dev", "prod"]
restart: always
volumes:
- ./db:/var/lib/mysql
- ./sql_dump:/sql_dump
environment:
MARIADB_ROOT_PASSWORD: rootpassword
MARIADB_USER: lmddc
MARIADB_PASSWORD: password
MARIADB_DATABASE: tour
networks:
- app-network
vue-dev:
image: node:21-bookworm
profiles: ["dev"]
volumes:
- ./vue-app:/usr/src/app
stdin_open: true
tty: true
ports:
- "5173:5173"
working_dir: /usr/src/app
command: sh -c "npm install && npm run dev -- --host"
restart: unless-stopped
stop_grace_period: 1s
networks:
- app-network
vue-build:
image: node:21-bookworm
profiles: ["build", "prod"]
volumes:
- ./vue-app:/usr/src/app
working_dir: /usr/src/app
command: sh -c "npm install && npm run build"
networks:
app-network:
driver: bridge