maybe fix docker?
This commit is contained in:
parent
57eda7d007
commit
16f920d0b4
10
Dockerfile
10
Dockerfile
@ -6,9 +6,11 @@ RUN DEBIAN_FRONTEND=noninteractive \
|
|||||||
apt install nginx php-fpm php-gd -y
|
apt install nginx php-fpm php-gd -y
|
||||||
|
|
||||||
# Set up nginx
|
# Set up nginx
|
||||||
COPY ./conf/nginx.conf /etc/nginx/nginx.conf
|
COPY ./docker/nginx.conf /etc/nginx/nginx.conf
|
||||||
RUN mkdir -p /var/www/html
|
RUN mkdir -p /var/www/html
|
||||||
COPY ./upload.php /var/www/html/index.php
|
|
||||||
|
|
||||||
# Start NGINX
|
# Setup scripts
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
COPY ./docker/start.sh /start.sh
|
||||||
|
|
||||||
|
# Start server
|
||||||
|
CMD ["bash", "/start.sh"]
|
@ -3,6 +3,8 @@ events {
|
|||||||
}
|
}
|
||||||
|
|
||||||
http {
|
http {
|
||||||
|
access_log /dev/stdout;
|
||||||
|
|
||||||
server {
|
server {
|
||||||
server_name _;
|
server_name _;
|
||||||
listen 80;
|
listen 80;
|
||||||
@ -13,7 +15,7 @@ http {
|
|||||||
gzip_proxied any;
|
gzip_proxied any;
|
||||||
gzip_comp_level 8;
|
gzip_comp_level 8;
|
||||||
gzip_buffers 16 64k;
|
gzip_buffers 16 64k;
|
||||||
gzip_types text/plain text/html text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
||||||
|
|
||||||
root /var/www/html;
|
root /var/www/html;
|
||||||
index index.html index.htm;
|
index index.html index.htm;
|
13
docker/start.sh
Normal file
13
docker/start.sh
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
UPLOAD_SCRIPT="upload.php"
|
||||||
|
|
||||||
|
echo "Checking if $UPLOAD_SCRIPT exists in /var/www/html"
|
||||||
|
if [ -f "$UPLOAD_SCRIPT" ]; then
|
||||||
|
echo "$FILE exists, not copying"
|
||||||
|
else
|
||||||
|
cp /var/www/html/$UPLOAD_SCRIPT $UPLOAD_SCRIPT
|
||||||
|
echo "$UPLOAD_SCRIPT copied to /var/www/html/$UPLOAD_SCRIPT"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Start Nginx
|
||||||
|
echo "Starting Nginx"
|
||||||
|
nginx -g "daemon off;"
|
Loading…
Reference in New Issue
Block a user