nginx
Some checks are pending
Web App CI / test (push) Waiting to run
Web App CI / build (push) Blocked by required conditions
Deploy Mnemo Cards / Deploy Backend (push) Waiting to run
Deploy Mnemo Cards / Deploy Web App (push) Blocked by required conditions
Deploy Mnemo Cards / Final Verification (push) Blocked by required conditions
Some checks are pending
Web App CI / test (push) Waiting to run
Web App CI / build (push) Blocked by required conditions
Deploy Mnemo Cards / Deploy Backend (push) Waiting to run
Deploy Mnemo Cards / Deploy Web App (push) Blocked by required conditions
Deploy Mnemo Cards / Final Verification (push) Blocked by required conditions
This commit is contained in:
parent
c5d0df53c3
commit
9c3d2e8b5b
2 changed files with 33 additions and 4 deletions
|
|
@ -31,14 +31,14 @@ RUN flutter build web --release \
|
|||
--dart-define=API_BASE_URL=${API_BASE_URL}
|
||||
|
||||
# --- Runtime stage ----------------------------------------------------------
|
||||
# FROM nginx:1.27-alpine AS runtime
|
||||
FROM nginx:1.27-alpine AS runtime
|
||||
# Copy nginx config
|
||||
# COPY mnemo_cards_web_v2/nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY mnemo_cards_web_v2/nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
# Copy built web app
|
||||
# COPY --from=build /app/mnemo_cards_web_v2/build/web/ /usr/share/nginx/html/
|
||||
COPY --from=build /app/mnemo_cards_web_v2/build/web/ /usr/share/nginx/html/
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
# HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
|
||||
# CMD wget -qO- http://127.0.0.1/ >/dev/null 2>&1 || exit 1
|
||||
CMD wget -qO- http://127.0.0.1/ >/dev/null 2>&1 || exit 1
|
||||
|
|
|
|||
29
mnemo_cards_web_v2/nginx.conf
Normal file
29
mnemo_cards_web_v2/nginx.conf
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
# Gzip compression
|
||||
gzip on;
|
||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml text/javascript;
|
||||
gzip_min_length 1000;
|
||||
|
||||
# Cache static assets
|
||||
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable";
|
||||
}
|
||||
|
||||
# Flutter web app - SPA routing
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
# Health check endpoint
|
||||
location /health {
|
||||
access_log off;
|
||||
return 200 "OK";
|
||||
add_header Content-Type text/plain;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue