- frontend.Dockerfile: runtime-only, COPY apps/frontend/dist instead of building in Docker - build.js: add frontend build step (pnpm build) before docker build - drone.yml: remove obsolete frontend-deps/frontend-build steps
32 lines
863 B
Docker
32 lines
863 B
Docker
# Runtime only — frontend built externally via pnpm
|
|
FROM nginx:alpine
|
|
|
|
# Copy pre-built SPA assets
|
|
COPY apps/frontend/dist /usr/share/nginx/html
|
|
|
|
# nginx configuration for SPA
|
|
RUN echo 'server { \
|
|
listen 80; \
|
|
server_name _; \
|
|
root /usr/share/nginx/html; \
|
|
index index.html; \
|
|
location / { \
|
|
try_files $uri $uri/ /index.html; \
|
|
} \
|
|
location /api/ { \
|
|
proxy_pass http://app:8080/api/; \
|
|
proxy_set_header Host $host; \
|
|
proxy_set_header X-Real-IP $remote_addr; \
|
|
} \
|
|
location /ws/ { \
|
|
proxy_pass http://app:8080/ws/; \
|
|
proxy_http_version 1.1; \
|
|
proxy_set_header Upgrade $http_upgrade; \
|
|
proxy_set_header Connection "upgrade"; \
|
|
proxy_set_header Host $host; \
|
|
} \
|
|
}' > /etc/nginx/conf.d/default.conf
|
|
|
|
EXPOSE 80
|
|
ENTRYPOINT ["nginx", "-g", "daemon off;"]
|