Added docker compose with configuration
This commit is contained in:
parent
d762f41f9c
commit
a5447e2485
21
config/docker/dev/nginx/default.conf
Normal file
21
config/docker/dev/nginx/default.conf
Normal 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;
|
||||
}
|
||||
}
|
12
config/docker/dev/php/Dockerfile
Normal file
12
config/docker/dev/php/Dockerfile
Normal 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
33
docker-compose.yml
Normal 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
|
Loading…
x
Reference in New Issue
Block a user