Dropped official nginx image, starting from alpine

master
Meliurwen 4 years ago
parent 2eb7c3dd79
commit 8c66897b14
Signed by: meliurwen
GPG Key ID: 818A8B35E9F1CE10
  1. 4
      Dockerfile
  2. 2
      docker-compose.yml
  3. 8
      root/entrypoint.sh

@ -2,9 +2,9 @@ FROM nginx:stable-alpine
LABEL maintainer="Meliurwen <meliruwen@gmail.com>" LABEL maintainer="Meliurwen <meliruwen@gmail.com>"
RUN apk --no-cache add tzdata && \ RUN apk --no-cache add nginx tzdata && \
mkdir -p /defaults /data /config/conf.d mkdir -p /defaults /data /config/conf.d
COPY root/ / COPY root/ /
ENTRYPOINT [./entrypoint.sh] ENTRYPOINT ["/entrypoint.sh"]

@ -7,7 +7,7 @@ services:
restart: ${NG_RESTART:-unless-stopped} restart: ${NG_RESTART:-unless-stopped}
volumes: volumes:
- ${LOCAL_STACK_DIR}/data:/data:ro - ${LOCAL_STACK_DIR}/data:/data:ro
- ${LOCAL_STACK_DIR}/config:/config:ro - ${LOCAL_STACK_DIR}/config:/config
env_file: env_file:
- static-websites.env - static-websites.env
environment: environment:

@ -15,9 +15,15 @@ if [ ! -e /config/mime.types ]; then
cp /etc/nginx/mime.types /config/mime.types; cp /etc/nginx/mime.types /config/mime.types;
fi 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 # Check if conf.d directory has websites configuration files
if [ -z "$(ls -A /config/conf.d)" ]; then 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; cp /etc/nginx/conf.d/default.conf /config/conf.d/default.conf;
fi fi

Loading…
Cancel
Save