Added docker compose with configuration

This commit is contained in:
Kamil Niemczycki 2022-04-19 13:23:00 +02:00
parent d762f41f9c
commit a5447e2485
3 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,21 @@
server {
listen 80 default_server;
index index.php index.html;
root /application/public;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass php:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /.ht {
deny all;
}
}

View File

@ -0,0 +1,12 @@
FROM php:8.0-fpm
ARG USER_UID
ARG USER_NAME
RUN useradd -G www-data,root -u $USER_UID -d /home/$USER_NAME $USER_NAME
RUN mkdir -p /home/$USER_NAME/.composer && \
chown -R $USER_NAME:$USER_NAME /home/$USER_NAME
USER $USER_UID
EXPOSE 9000

33
docker-compose.yml Normal file
View File

@ -0,0 +1,33 @@
version: "3.9"
services:
nginx:
image: nginx:latest
container_name: kamilcraft-api_www
working_dir: /application
ports:
- "80:80"
volumes:
- .:/application
- ./config/docker/dev/nginx/default.conf:/etc/nginx/conf.d/default.conf
links:
- php
networks:
- localnet
php:
build:
args:
USER_UID: ${USER_UID}
USER_NAME: ${USER_NAME}
context: ./config/docker/dev/php
container_name: kamilcraft-api_php8
working_dir: /application
volumes:
- .:/application
networks:
- localnet
networks:
localnet:
driver: bridge