Skip to content

Commit

Permalink
fix nginx.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
TuuKeZu committed Aug 19, 2024
1 parent 6501df6 commit f8049f8
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,21 @@ RUN --mount=type=cache,target=/root/.npm \
RUN npm run build

FROM nginx:latest
COPY --from=build /otawilma/build /usr/share/nginx/html/

COPY nginx.conf /etc/nginx/conf.d/default.conf

COPY --from=build /otawilma/build /usr/share/nginx/html/

WORKDIR /app
RUN chown -R nginx:nginx /app && chmod -R 755 /app && \
chown -R nginx:nginx /var/cache/nginx && \
chown -R nginx:nginx /var/log/nginx && \
chown -R nginx:nginx /etc/nginx/conf.d
RUN touch /var/run/nginx.pid && \
chown -R nginx:nginx /var/run/nginx.pid

USER nginx

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]
19 changes: 19 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
server {
listen 80;
server_name localhost;

location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

location /health {
return 200;
}
}

0 comments on commit f8049f8

Please sign in to comment.