From 808649de7fde3bbddf4e5185cdc3b3ecfb83bc0a Mon Sep 17 00:00:00 2001 From: William Date: Thu, 29 Dec 2022 03:05:39 +0000 Subject: [PATCH] Poo --- docker/Dockerfile | 10 +++++++--- docker/README.md | 4 +++- docker/nginx.conf | 3 +++ docker/run.sh | 2 ++ 4 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 docker/run.sh diff --git a/docker/Dockerfile b/docker/Dockerfile index 221c842..dc16e56 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -12,8 +12,12 @@ RUN mkdir /www && \ chown -R www:www /var/lib/nginx && \ chown -R www:www /www -COPY nginx.conf /etc/nginx/nginx.conf +COPY ./docker/nginx.conf /etc/nginx/nginx.conf -COPY ../ /www +COPY ./ /www -CMD ["nginx && php-fpm81 && sleep infinity"] \ No newline at end of file +COPY ./docker/run.sh /opt/run.sh + +RUN chmod +x /opt/run.sh + +CMD ["/opt/run.sh"] \ No newline at end of file diff --git a/docker/README.md b/docker/README.md index ebdca68..038cf1f 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1 +1,3 @@ -# Docker install \ No newline at end of file +# Docker install + + docker build --no-cache -f ./docker/Dockerfile --tag willy-club-website \ No newline at end of file diff --git a/docker/nginx.conf b/docker/nginx.conf index aef44de..95516d0 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -25,6 +25,9 @@ http { location = /50x.html { root /var/lib/nginx/html; } + location / { + try_files $uri $uri/ /index.php?$query_string; + } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; diff --git a/docker/run.sh b/docker/run.sh new file mode 100644 index 0000000..1e225a6 --- /dev/null +++ b/docker/run.sh @@ -0,0 +1,2 @@ +#!/bin/sh +nginx && php-fpm81 && read var \ No newline at end of file