diff --git a/Dockerfile b/Dockerfile index 6d7eaaf..563dda1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,9 +2,9 @@ FROM nginx:stable-alpine LABEL maintainer="Meliurwen " -RUN apk --no-cache add tzdata && \ +RUN apk --no-cache add nginx tzdata && \ mkdir -p /defaults /data /config/conf.d COPY root/ / -ENTRYPOINT [./entrypoint.sh] +ENTRYPOINT ["/entrypoint.sh"] diff --git a/docker-compose.yml b/docker-compose.yml index 5cf1d69..a5ef282 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,7 @@ services: restart: ${NG_RESTART:-unless-stopped} volumes: - ${LOCAL_STACK_DIR}/data:/data:ro - - ${LOCAL_STACK_DIR}/config:/config:ro + - ${LOCAL_STACK_DIR}/config:/config env_file: - static-websites.env environment: diff --git a/root/entrypoint.sh b/root/entrypoint.sh index 01989ce..f2dac48 100755 --- a/root/entrypoint.sh +++ b/root/entrypoint.sh @@ -15,9 +15,15 @@ if [ ! -e /config/mime.types ]; then cp /etc/nginx/mime.types /config/mime.types; fi +# Check if conf.d directory exists +if [ ! -d /config/conf.d ]; then + echo "Directory /config/conf.d not found. Creating it..."; + mkdir /config/conf.d +fi + # Check if conf.d directory has websites configuration files if [ -z "$(ls -A /config/conf.d)" ]; then - echo "The /config/conf.d directory is empty. Copying default.conf..."; + echo "Directory /config/conf.d directory empty. Copying default.conf..."; cp /etc/nginx/conf.d/default.conf /config/conf.d/default.conf; fi