-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
208 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# PostgreSQL | ||
POSTGRES_DB=project | ||
POSTGRES_USER=ps_user | ||
POSTGRES_PASSWORD=ps_password | ||
POSTGRES_HOST=postgres | ||
|
||
# Redis | ||
REDIS_REPLICATION_MODE=master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
.idea/ | ||
/vendor/ | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
version: '3' | ||
|
||
services: | ||
nginx: | ||
build: | ||
context: . | ||
dockerfile: docker/nginx/Dockerfile | ||
restart: on-failure | ||
ports: | ||
- "80:80" | ||
volumes: | ||
- ./project:/var/www/project | ||
- ./docker/sock:/sock | ||
networks: | ||
- project-network | ||
|
||
php: | ||
build: | ||
context: . | ||
dockerfile: docker/php-fpm/Dockerfile | ||
restart: on-failure | ||
volumes: | ||
- ./project:/var/www/project | ||
- ./docker/sock:/sock | ||
networks: | ||
- project-network | ||
|
||
postgres: | ||
build: | ||
context: . | ||
dockerfile: docker/postgres/Dockerfile | ||
restart: on-failure | ||
environment: | ||
POSTGRES_DB: ${POSTGRES_DB} | ||
POSTGRES_USER: ${POSTGRES_USER} | ||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} | ||
PGDATA: /var/lib/postgresql/data | ||
volumes: | ||
- db-data:/var/lib/postgresql/data:rw | ||
ports: | ||
- "5432:5432" | ||
networks: | ||
- project-network | ||
|
||
redis: | ||
image: "redis:alpine" | ||
command: redis-server | ||
restart: on-failure | ||
ports: | ||
- "6379:6379" | ||
environment: | ||
- REDIS_REPLICATION_MODE=${REDIS_REPLICATION_MODE} | ||
networks: | ||
- project-network | ||
|
||
memcached: | ||
image: "memcached:alpine" | ||
restart: on-failure | ||
ports: | ||
- "11211:11211" | ||
networks: | ||
- project-network | ||
|
||
volumes: | ||
db-data: | ||
|
||
networks: | ||
project-network: | ||
driver: bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
ARG NGINX_VERSION=1.25.3 | ||
|
||
FROM nginx:${NGINX_VERSION} | ||
|
||
COPY docker/nginx/default.conf /etc/nginx/conf.d/ | ||
|
||
EXPOSE 80 | ||
EXPOSE 443 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
server { | ||
server_name localhost; | ||
root /var/www/project/public; | ||
|
||
location / { | ||
try_files $uri /index.php$is_args$args; | ||
} | ||
|
||
location ~ ^/index\.php(/|$) { | ||
fastcgi_pass unix:/sock/docker.sock; | ||
|
||
fastcgi_split_path_info ^(.+\.php)(/.*)$; | ||
include fastcgi_params; | ||
|
||
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; | ||
fastcgi_param DOCUMENT_ROOT $realpath_root; | ||
|
||
internal; | ||
} | ||
|
||
location ~ \.php$ { | ||
return 404; | ||
} | ||
|
||
error_log /var/log/nginx/project_error.log; | ||
access_log /var/log/nginx/project_access.log; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
ARG PHP_VERSION=8.3-fpm | ||
|
||
FROM php:${PHP_VERSION} | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
libfreetype6-dev \ | ||
libjpeg62-turbo-dev \ | ||
libpng-dev \ | ||
libpq-dev \ | ||
libonig-dev \ | ||
libzip-dev \ | ||
libmemcached-dev \ | ||
libssl-dev \ | ||
libmcrypt-dev \ | ||
&& pecl install mcrypt-1.0.7 \ | ||
&& docker-php-ext-enable mcrypt \ | ||
&& docker-php-ext-install -j$(nproc) pgsql pdo pdo_pgsql opcache bcmath zip \ | ||
&& docker-php-ext-configure gd --with-freetype --with-jpeg \ | ||
&& docker-php-ext-install -j$(nproc) gd \ | ||
&& pecl install memcached \ | ||
&& docker-php-ext-enable memcached \ | ||
&& pecl install redis \ | ||
&& docker-php-ext-enable redis | ||
|
||
COPY docker/php-fpm/php.ini $PHP_INI_DIR/conf.d/php.ini | ||
COPY docker/php-fpm/www.conf /usr/local/etc/php-fpm.d/zz-docker.conf | ||
|
||
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && php composer-setup.php --install-dir=/usr/local/bin --filename=composer | ||
|
||
RUN usermod -u 1000 www-data | ||
|
||
COPY --chown=www-data:www-data project/ /var/www/project/ | ||
|
||
RUN chown -R www-data:www-data /var/www | ||
|
||
WORKDIR /var/www/project | ||
|
||
USER www-data | ||
|
||
RUN export COMPOSER_HOME=$(pwd) && composer --no-progress --prefer-dist --no-interaction install; | ||
|
||
CMD ["php-fpm"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
date.timezone=Europe/Moscow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[global] | ||
daemonize = no | ||
|
||
[www] | ||
listen = /sock/docker.sock | ||
listen.mode = 0666 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ARG POSTGRESQL_VERSION=16.2-alpine | ||
|
||
FROM postgres:${POSTGRESQL_VERSION} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/var/ | ||
/vendor/ | ||
/cache/ | ||
/.env.local | ||
.env | ||
/.env.*.local | ||
.htaccess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "sfadeev/project", | ||
"type": "project", | ||
"autoload": { | ||
"psr-4": { | ||
"Sfadeev\\Project\\": "src/" | ||
} | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "Sergey Fadeev", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require": {} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?php | ||
phpinfo(); |