-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
86 lines (79 loc) · 2.22 KB
/
docker-compose.yml
File metadata and controls
86 lines (79 loc) · 2.22 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
services:
nginx:
image: nginx:alpine3.21
container_name: nginx_proxy_daskomrec25
restart: unless-stopped
ports:
- "8001:80"
volumes:
- ./docker/nginx.conf:/etc/nginx/conf.d/default.conf # Nginx config
- .:/var/www/
depends_on:
- daskomrec25
- cache-npm-daskomrec25
- cache-composer-daskomrec25
- mysql
daskomrec25:
build:
context: .
volumes:
- .:/var/www/
command: "php-fpm -F"
user: "1000:1000"
expose:
- "9000"
depends_on:
- cache-npm-daskomrec25
- cache-composer-daskomrec25
#########################################
# MYSQL SERVER #
#########################################
mysql:
image: mysql:8.0
container_name: mysql_daskomrec25
restart: unless-stopped
environment:
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
MYSQL_PASSWORD: ${DB_PASSWORD}
expose:
- "3306"
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
restart: unless-stopped
environment:
PMA_HOST: ${DB_HOST}
PMA_USER: ${DB_USERNAME}
PMA_PASSWORD: ${DB_PASSWORD}
ports:
- 8081:80
#########################################
# NPM AND COMPOSER CACHE #
#########################################
cache-npm-daskomrec25:
image: node:lts-alpine3.21
working_dir: /app
volumes:
- .:/app
command: sh -c "[ ! -d ./public/build ] && npm install && npm run build || echo 'Build already exists, skipping...'"
user: "1000:1000"
restart: "no"
depends_on:
- cache-composer-daskomrec25
cache-composer-daskomrec25:
image: php:8.3.17-fpm-alpine3.21
working_dir: /var
volumes:
- .:/var
command: >
sh -c "
if ! command -v composer >/dev/null 2>&1; then
curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/local/bin/composer;
fi;
if [ ! -d ./vendor ]; then
composer install --optimize-autoloader --no-dev --ignore-platform-req=ext-gd --ignore-platform-req=ext-zip;
else
echo 'Vendor folder already exists, skipping...';
fi
chown -R 1000:1000 ./vendor"
restart: "no"