From acc58d874e1ce47dbd47f77b690060d766baf844 Mon Sep 17 00:00:00 2001 From: SquiddyPoos Date: Tue, 28 Nov 2023 23:45:09 +0800 Subject: [PATCH] back to nginx --- frontend/Dockerfile | 13 ++++--------- frontend/nginx.conf | 7 +++++++ 2 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 frontend/nginx.conf diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 2cb7306..4d9e335 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,9 +1,4 @@ -FROM busybox:musl - -RUN adduser -D static -USER static -WORKDIR /home/static - -COPY /dist . -EXPOSE 3000 -CMD ["busybox", "httpd", "-f", "-v", "-p", "3000"] \ No newline at end of file +FROM nginx:alpine-slim +EXPOSE 80 +COPY nginx.conf /etc/nginx/nginx.conf +COPY dist /usr/share/nginx/html \ No newline at end of file diff --git a/frontend/nginx.conf b/frontend/nginx.conf new file mode 100644 index 0000000..85e6124 --- /dev/null +++ b/frontend/nginx.conf @@ -0,0 +1,7 @@ +server { + listen 80; + root /usr/share/nginx/html; + location / { + try_files $uri $uri/ /index.html; + } +} \ No newline at end of file