nginx
Some checks are pending
Backend CI / test (push) Waiting to run
Backend CI / build (push) Blocked by required conditions
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:
Dmitry 2025-12-11 04:41:36 +03:00
parent da4e71a2b4
commit b04f572373
2 changed files with 15 additions and 3 deletions

View file

@ -57,4 +57,5 @@ HEALTHCHECK --interval=15s --timeout=5s --start-period=10s --retries=5 \
CMD curl -sf http://127.0.0.1:8081/api/v2/packs || exit 1 CMD curl -sf http://127.0.0.1:8081/api/v2/packs || exit 1
# Use environment variables with fallbacks # Use environment variables with fallbacks
CMD ["/app/server", "-a", "0.0.0.0", "-p", "8081", "--isar", "/app/isar", "--backup", "/app/backups", "--workdir", "/app"] # PORT env var can be overridden by Coolify/docker-compose
CMD sh -c "/app/server -a ${ADDRESS:-0.0.0.0} -p ${PORT:-8081} --isar ${ISAR_DIR:-/app/isar} --backup ${BACKUP_DIR:-/app/backups} --workdir ${APP_WORKDIR:-/app}"

View file

@ -30,15 +30,26 @@ ARG API_BASE_URL=https://api.mnemo-cards.online
RUN flutter build web --release \ RUN flutter build web --release \
--dart-define=API_BASE_URL=${API_BASE_URL} --dart-define=API_BASE_URL=${API_BASE_URL}
# Verify build output
RUN ls -la build/web/ && test -f build/web/index.html || (echo "ERROR: index.html not found!" && exit 1)
# --- Runtime stage ---------------------------------------------------------- # --- Runtime stage ----------------------------------------------------------
FROM nginx:1.27-alpine AS runtime FROM nginx:1.27-alpine AS runtime
# Install wget for healthcheck
RUN apk add --no-cache wget
# Copy nginx config # 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 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/
# Verify files were copied
RUN ls -la /usr/share/nginx/html/ && test -f /usr/share/nginx/html/index.html || (echo "ERROR: index.html not copied!" && exit 1)
EXPOSE 80 EXPOSE 80
# HEALTHCHECK --interval=30s --timeout=5s --retries=3 \ # Healthcheck
CMD wget -qO- http://127.0.0.1/ >/dev/null 2>&1 || exit 1 HEALTHCHECK --interval=30s --timeout=5s --retries=3 --start-period=10s \
CMD wget --no-verbose --tries=1 --spider http://127.0.0.1/ || exit 1