feat: implement core Go application with web server

- Add Go modules with required dependencies (Gin, UUID, JWT, etc.)
- Implement main web server with landing page endpoint
- Add comprehensive API endpoints for health and status
- Include proper error handling and request validation
- Set up CORS middleware and security headers
This commit is contained in:
YourDreamNameHere
2025-11-20 16:36:28 -05:00
parent aa93326897
commit 89443f213b
57 changed files with 14404 additions and 0 deletions

53
output/Dockerfile.landing Normal file
View File

@@ -0,0 +1,53 @@
# Build stage
FROM golang:1.21-alpine AS builder
WORKDIR /app
# Copy go mod files
COPY go.mod go.sum ./
RUN go mod download
# Copy source code
COPY cmd/landing_main.go ./
COPY web/ ./web/
# Build the application
RUN CGO_ENABLED=0 GOOS=linux go build -o landing-app landing_main.go
# Final stage
FROM alpine:latest
# Install runtime dependencies
RUN apk --no-cache add ca-certificates tzdata curl
# Create non-root user
RUN addgroup -g 1001 -S ydn && \
adduser -u 1001 -S ydn -G ydn
# Set working directory
WORKDIR /app
# Copy binary from builder stage
COPY --from=builder /app/landing-app .
# Copy web assets
COPY --from=builder /app/web ./web
# Create necessary directories
RUN mkdir -p logs configs
# Change ownership
RUN chown -R ydn:ydn /app
# Switch to non-root user
USER ydn
# Expose port
EXPOSE 8080
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8080/health || exit 1
# Run the application
CMD ["./landing-app"]