Skip to content

Commit

Permalink
fix: nginx spa
Browse files Browse the repository at this point in the history
  • Loading branch information
2paperstar committed Jun 5, 2024
1 parent 4c825c7 commit f9fb052
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ RUN yarn build

# production environment

FROM nginx:1.16.0-alpine
FROM nginx:stable-alpine

COPY --from=build /app/dist /usr/share/nginx/html
RUN rm /etc/nginx/conf.d/default.conf
COPY nginx/nginx.conf /etc/nginx/conf.d

EXPOSE 80

Expand Down
10 changes: 10 additions & 0 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
server {
listen 80;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
}

0 comments on commit f9fb052

Please sign in to comment.