Files
tatlock-ui/Dockerfile
T
Jeroen SchweitzerandClaude Opus 4.5 ce2dfcd13c
Build and Push / release (push) Successful in 3s
Build and Push / build (push) Successful in 2m57s
fix(build): add production API URLs to Docker build
Dockerfile now passes --dart-define flags for CORE_API_URL and
TATLOCK_API_URL pointing to schweitz.net domains. This enables
requiresAuth=true, fixing auth being completely skipped in production.

Also added service port reference table to AGENTS.md.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 23:19:32 +01:00

45 lines
1.2 KiB
Docker

# Stage 1: Build Flutter web application
FROM ghcr.io/cirruslabs/flutter:stable AS builder
WORKDIR /app
# Copy dependency files first for better caching
COPY pubspec.yaml ./
# Get dependencies (generates pubspec.lock)
RUN flutter pub get
# Copy the rest of the application
COPY . .
# Generate code with build_runner
RUN dart run build_runner build --delete-conflicting-outputs
# Build for web release with production configuration
# These URLs enable authentication (requiresAuth = true when URL contains schweitz.net)
RUN flutter build web --release \
--dart-define=CORE_API_URL=https://api.schweitz.net \
--dart-define=TATLOCK_API_URL=https://tatlock.schweitz.net
# Stage 2: Serve with nginx
FROM nginx:alpine
# Install curl for healthcheck
RUN apk add --no-cache curl
# Copy custom nginx configuration
COPY nginx.conf /etc/nginx/nginx.conf
# Copy built web app to nginx html directory
COPY --from=builder /app/build/web /usr/share/nginx/html
# Expose port 80
EXPOSE 80
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:80/ || exit 1
# Run nginx in foreground
CMD ["nginx", "-g", "daemon off;"]