Skip to content

Commit c7df98a

Browse files
author
Evgenii Mykhalichenko
committed
Big update: revision of the skeleton concept
1 parent 8d853f5 commit c7df98a

File tree

11 files changed

+25
-67
lines changed

11 files changed

+25
-67
lines changed

.env_example

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Docker
22
DOCKER_PREFIX=skeleton
3-
DOCKER_WORK_DIR=/var/www/backend
3+
DOCKER_WORK_DIR=/var/www/html
44

55
# Nginx
66
NGINX_VERSION=latest

docker-compose.yml

+5-11
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ services:
3535
environment:
3636
- REDIS_HOSTS=local:redis
3737
ports:
38-
- "${REDIS_COMMANDER_PORT}:8081"
38+
- "${REDIS_COMMANDER_PORT}:8081" # UI with http://localhost:8081/
3939
networks:
4040
- backend-network
4141

@@ -59,23 +59,17 @@ services:
5959
networks:
6060
- backend-network
6161

62-
backend:
62+
php:
6363
container_name: "${DOCKER_PREFIX}-backend"
6464
build:
65-
context: ./docker/backend
65+
context: ./docker/php
6666
dockerfile: Dockerfile
67-
args:
68-
- WORK_DIR=${DOCKER_WORK_DIR}
69-
- XDEBUG_MODE=${XDEBUG_MODE}
70-
- XDEBUG_CLIENT_HOST=${XDEBUG_CLIENT_HOST}
71-
- XDEBUG_IDKEY=${XDEBUG_IDKEY}
72-
- XDEBUG_CLIENT_PORT=${XDEBUG_CLIENT_PORT}
7367
restart: always
7468
env_file:
7569
- .env
7670
volumes:
7771
- "./src:${DOCKER_WORK_DIR}"
78-
- ./logs/supervisor/:/var/log/supervisor/
72+
- "./docker/php/conf.d/php.ini:/usr/local/etc/php/php.ini:ro"
7973
networks:
8074
- backend-network
8175

@@ -91,7 +85,7 @@ services:
9185
networks:
9286
- backend-network
9387
ports:
94-
- "9001:9001" # Access GUI with http://localhost:9001/
88+
- "9001:9001" # UI with http://localhost:9001/
9589

9690
networks:
9791
backend-network:

docker/backend/Dockerfile

-49
This file was deleted.

docker/backend/php/conf.d/php.ini

Whitespace-only changes.

docker/nginx/conf.d/default.conf

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
server {
22
listen 80 default_server;
33
listen [::]:80 default_server;
4-
root /var/www/backend/public;
4+
root /var/www/html/public;
55

6-
server_name api.loc;
6+
server_name localhost;
77

88
index index.php;
99

@@ -15,7 +15,7 @@ server {
1515
}
1616

1717
location ~ \.php$ {
18-
fastcgi_pass backend:9000;
18+
fastcgi_pass php:9000;
1919
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
2020
include fastcgi_params;
2121
}

docker/nginx/default.template.conf

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
server {
22
listen 80 default_server;
33
listen [::]:80 default_server;
4-
root /var/www/backend/public;
4+
root /var/www/html/public;
55

66
server_name ${NGINX_HOST};
77

@@ -15,7 +15,7 @@ server {
1515
}
1616

1717
location ~ \.php$ {
18-
fastcgi_pass backend:9000;
18+
fastcgi_pass php:9000;
1919
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
2020
include fastcgi_params;
2121
}

docker/php/Dockerfile

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM php:8.1-fpm
2+
3+
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
4+
5+
RUN install-php-extensions pdo_mysql
6+
RUN install-php-extensions mysqli
7+
RUN install-php-extensions redis
8+
RUN install-php-extensions zip
9+
RUN install-php-extensions intl
10+
RUN install-php-extensions gd
11+
RUN install-php-extensions xdebug
12+
RUN install-php-extensions @composer

docker/php/conf.d/php.ini

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
date.timezone = UTC
File renamed without changes.

docker/supervisord/conf.d/example.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[program:messenger-consume]
2-
command=php /var/www/backend/src/bin/supervisor
2+
command=php /var/www/html/src/bin/supervisord.php
33
user=root
44
numprocs=1
55
startsecs=0
File renamed without changes.

0 commit comments

Comments
 (0)