fix: Embed nginx config in Dockerfile instead of copying file

This commit is contained in:
Khoa Vo 2026-04-27 18:24:45 +07:00
parent 6cf50018f2
commit e19ec4a01b
2 changed files with 24 additions and 1 deletions

23
docker/.dockerignore Normal file
View file

@ -0,0 +1,23 @@
# Dependencies
node_modules
# Git
.git
.github
# IDE
.idea
.vscode
# OS
.DS_Store
# Environment
.env
.env.*
# Documentation
*.md
# Docker (but keep our Dockerfile)
docker-compose*.yml

View file

@ -31,7 +31,7 @@ FROM nginx:1.28.2-alpine
COPY --from=builder /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
RUN echo 'server { listen 4173; root /usr/share/nginx/html; index index.html; location / { try_files $uri $uri/ /index.html; } location ~* \.(?:css|js|mjs|map|json|wasm|mp3|flac|wav|ogg|png|jpg|jpeg|svg|webp|ico|gz|br|ttf|woff2?)$ { try_files $uri =404; } }' > /etc/nginx/conf.d/default.conf
# Expose the nginx port
EXPOSE 4173