Skip to content
Snippets Groups Projects
Commit b22a6616 authored by asitis's avatar asitis
Browse files

fix: Nginx 권한 문제로 인한 캐싱 오류 수정

parent fc0387dd
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@ RUN pnpm run build
FROM nginx:stable-alpine
RUN apk add --no-cache fcgiwrap spawn-fcgi
RUN apk add --no-cache fcgiwrap spawn-fcgi shadow
COPY rootfs/ /
COPY --from=build /app/dist /app/frontend
......
#!/bin/sh
set -e
PUID=${PUID:-1000}
PGID=${PGID:-1000}
if getent group nginx >/dev/null; then
if [ "$(id -g nginx)" -ne "$PGID" ]; then
groupmod -o -g "$PGID" nginx
fi
else
addgroup -S -g "$PGID" nginx
fi
if getent passwd nginx >/dev/null; then
if [ "$(id -u nginx)" -ne "$PUID" ] || [ "$(id -g nginx)" -ne "$PGID" ]; then
usermod -o -u "$PUID" -g "$PGID" nginx
fi
else
adduser -S -u "$PUID" -G nginx -H -D nginx
fi
# Create necessary directories
mkdir -p /data/custom_ssl /data/logs /data/access /data/nginx /data/letsencrypt-acme-challenge /data/nginx/default_host /data/nginx/default_www /data/nginx/proxy_host /data/nginx/redirection_host /data/nginx/stream /data/nginx/dead_host /data/nginx/temp
mkdir -p /etc/letsencrypt /run/nginx /tmp/nginx/body /var/log/nginx /var/lib/nginx/cache/public /var/lib/nginx/cache/private /var/cache/nginx/proxy_temp
mkdir -p /var/run
# Set proper permissions
chown -R ${PUID:-1000}:${PGID:-1000} /data
chown -R ${PUID:-1000}:${PGID:-1000} /etc/letsencrypt
chown -R ${PUID:-1000}:${PGID:-1000} /run/nginx
chown -R ${PUID:-1000}:${PGID:-1000} /tmp/nginx
chown -R ${PUID:-1000}:${PGID:-1000} /var/cache/nginx
chown -R ${PUID:-1000}:${PGID:-1000} /var/lib/nginx
chown -R ${PUID:-1000}:${PGID:-1000} /var/log/nginx
chown -R ${PUID:-1000}:${PGID:-1000} /var/run
chown -R "$PUID:$PGID" /data
chown -R "$PUID:$PGID" /etc/letsencrypt
chown -R "$PUID:$PGID" /run/nginx
chown -R "$PUID:$PGID" /tmp/nginx
chown -R "$PUID:$PGID" /var/cache/nginx
chown -R "$PUID:$PGID" /var/lib/nginx
chown -R "$PUID:$PGID" /var/log/nginx
spawn-fcgi -s /var/run/fcgiwrap.socket -M 766 /usr/bin/fcgiwrap &
exec "$@"
# Run nginx in foreground
# daemon off;
pid /run/nginx/nginx.pid;
# user nginx;
user nginx nginx;
# Set number of worker processes automatically based on number of CPU cores.
worker_processes auto;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment