diff --git a/Dockerfile b/Dockerfile index d0bd6eb..e35bdf2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,8 +22,8 @@ FROM nginx:alpine # Copy built assets from builder stage COPY --from=builder /app/dist /usr/share/nginx/html -# Copy nginx configuration (optional - using default) -# COPY nginx.conf /etc/nginx/nginx.conf +# Copy nginx configuration +COPY nginx.conf /etc/nginx/conf.d/default.conf # Expose port 80 EXPOSE 80 diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..79738cb --- /dev/null +++ b/nginx.conf @@ -0,0 +1,14 @@ +server { + listen 80; + server_name localhost; + root /usr/share/nginx/html; + index index.html; + + # Handle React Router - serve index.html for all routes + location / { + try_files $uri $uri/ /index.html; + } + + # Error pages + error_page 404 /index.html; +}