From a41d1ceaead970283873862c19ec93533fd60f0e Mon Sep 17 00:00:00 2001 From: Alex Muszynski Date: Fri, 4 Jul 2025 10:04:28 -0400 Subject: [PATCH] feat: public self-hosting --- frontend/Dockerfile | 18 +++++++++++++----- frontend/nginx.conf | 11 +++++++++++ 2 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 frontend/nginx.conf diff --git a/frontend/Dockerfile b/frontend/Dockerfile index c3f5271..56c307e 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -7,8 +7,16 @@ ARG VITE_API_URL ENV VITE_API_URL=$VITE_API_URL RUN npm run build -FROM node:20-alpine -WORKDIR /app -COPY --from=builder /app ./ -EXPOSE 3000 -CMD ["npx", "vite", "--port", "3000"] +# Stage 2: Serve with NGINX +FROM nginx:alpine + +# Clean out default config +RUN rm /etc/nginx/conf.d/default.conf + +# Copy your custom nginx config +COPY nginx.conf /etc/nginx/conf.d/default.conf + +# Copy built files from Vite +COPY --from=builder /app/dist /usr/share/nginx/html + +EXPOSE 80 diff --git a/frontend/nginx.conf b/frontend/nginx.conf new file mode 100644 index 0000000..8032709 --- /dev/null +++ b/frontend/nginx.conf @@ -0,0 +1,11 @@ +server { + listen 80; + server_name localhost; + + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri /index.html; + } +}