diff --git a/Dockerfile b/Dockerfile index 5c5903c..4ad5968 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,7 +27,11 @@ RUN npm run build FROM nginx:1.23.2-alpine AS runner +# setup nginx +COPY ./nginx.conf /etc/nginx/conf.d/default.conf + RUN addgroup -S www && adduser -S www -G www # copy build files -COPY --from=builder /home/app/dist /usr/share/nginx/html +COPY --from=builder /home/app/dist /home/www/dist +RUN chown -R www:www /home/www/dist diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..303d45d --- /dev/null +++ b/nginx.conf @@ -0,0 +1,8 @@ +server { + listen 80 default_server; + listen [::]:80 default_server; + server_name _; + + root /home/www/dist; + try_files $uri $uri/ /index.html; +}