From f9fb05286c6a779e31eecf418a48b538ef37162b Mon Sep 17 00:00:00 2001 From: 2paperstar Date: Thu, 6 Jun 2024 04:54:21 +0900 Subject: [PATCH] fix: nginx spa --- Dockerfile | 4 +++- nginx/nginx.conf | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 nginx/nginx.conf diff --git a/Dockerfile b/Dockerfile index c88e458..ecd4743 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/nginx/nginx.conf b/nginx/nginx.conf new file mode 100644 index 0000000..539bb8f --- /dev/null +++ b/nginx/nginx.conf @@ -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; + } +} \ No newline at end of file