diff --git a/.htpasswd b/.htpasswd new file mode 100644 index 0000000..aebf246 --- /dev/null +++ b/.htpasswd @@ -0,0 +1 @@ +sprites:$apr1$DhpIgP1k$ZYo9mH0DVr.CLZCGJ0AqZ/ diff --git a/Dockerfile b/Dockerfile index 04849fd..cd9f70e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,6 +25,7 @@ RUN pnpm run build FROM nginx:alpine COPY nginx.conf /etc/nginx/conf.d/default.conf +COPY .htpasswd /etc/nginx/.htpasswd COPY --from=build /app/dist /usr/share/nginx/html EXPOSE 80 diff --git a/nginx.conf b/nginx.conf index e4f62ea..3583714 100644 --- a/nginx.conf +++ b/nginx.conf @@ -3,6 +3,9 @@ server { root /usr/share/nginx/html; error_page 404 /404.html; + auth_basic "Restricted"; + auth_basic_user_file /etc/nginx/.htpasswd; + location / { try_files $uri $uri/ $uri.html =404; }