Skip to content

Commit

Permalink
Big update: revision of the skeleton concept
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgenii Mykhalichenko committed Jul 2, 2022
1 parent 8d853f5 commit c7df98a
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 67 deletions.
2 changes: 1 addition & 1 deletion .env_example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Docker
DOCKER_PREFIX=skeleton
DOCKER_WORK_DIR=/var/www/backend
DOCKER_WORK_DIR=/var/www/html

# Nginx
NGINX_VERSION=latest
Expand Down
16 changes: 5 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ services:
environment:
- REDIS_HOSTS=local:redis
ports:
- "${REDIS_COMMANDER_PORT}:8081"
- "${REDIS_COMMANDER_PORT}:8081" # UI with http://localhost:8081/
networks:
- backend-network

Expand All @@ -59,23 +59,17 @@ services:
networks:
- backend-network

backend:
php:
container_name: "${DOCKER_PREFIX}-backend"
build:
context: ./docker/backend
context: ./docker/php
dockerfile: Dockerfile
args:
- WORK_DIR=${DOCKER_WORK_DIR}
- XDEBUG_MODE=${XDEBUG_MODE}
- XDEBUG_CLIENT_HOST=${XDEBUG_CLIENT_HOST}
- XDEBUG_IDKEY=${XDEBUG_IDKEY}
- XDEBUG_CLIENT_PORT=${XDEBUG_CLIENT_PORT}
restart: always
env_file:
- .env
volumes:
- "./src:${DOCKER_WORK_DIR}"
- ./logs/supervisor/:/var/log/supervisor/
- "./docker/php/conf.d/php.ini:/usr/local/etc/php/php.ini:ro"
networks:
- backend-network

Expand All @@ -91,7 +85,7 @@ services:
networks:
- backend-network
ports:
- "9001:9001" # Access GUI with http://localhost:9001/
- "9001:9001" # UI with http://localhost:9001/

networks:
backend-network:
Expand Down
49 changes: 0 additions & 49 deletions docker/backend/Dockerfile

This file was deleted.

Empty file removed docker/backend/php/conf.d/php.ini
Empty file.
6 changes: 3 additions & 3 deletions docker/nginx/conf.d/default.conf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/backend/public;
root /var/www/html/public;

server_name api.loc;
server_name localhost;

index index.php;

Expand All @@ -15,7 +15,7 @@ server {
}

location ~ \.php$ {
fastcgi_pass backend:9000;
fastcgi_pass php:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
Expand Down
4 changes: 2 additions & 2 deletions docker/nginx/default.template.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/backend/public;
root /var/www/html/public;

server_name ${NGINX_HOST};

Expand All @@ -15,7 +15,7 @@ server {
}

location ~ \.php$ {
fastcgi_pass backend:9000;
fastcgi_pass php:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
Expand Down
12 changes: 12 additions & 0 deletions docker/php/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM php:8.1-fpm

COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/

RUN install-php-extensions pdo_mysql
RUN install-php-extensions mysqli
RUN install-php-extensions redis
RUN install-php-extensions zip
RUN install-php-extensions intl
RUN install-php-extensions gd
RUN install-php-extensions xdebug
RUN install-php-extensions @composer
1 change: 1 addition & 0 deletions docker/php/conf.d/php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
date.timezone = UTC
File renamed without changes.
2 changes: 1 addition & 1 deletion docker/supervisord/conf.d/example.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[program:messenger-consume]
command=php /var/www/backend/src/bin/supervisor
command=php /var/www/html/src/bin/supervisord.php
user=root
numprocs=1
startsecs=0
Expand Down
File renamed without changes.

0 comments on commit c7df98a

Please sign in to comment.