Dockerfile 736 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. FROM dart:3.3.0 AS build
  2. # Set working directory
  3. WORKDIR /app
  4. # Copy pubspec files
  5. COPY pubspec.* ./
  6. RUN dart pub get
  7. # Copy source code
  8. COPY . .
  9. # Compile to native code using AOT
  10. RUN dart compile exe bin/server.dart -o server
  11. # Create runtime image
  12. FROM debian:bookworm-slim
  13. # Install SSL certificates for HTTPS requests
  14. RUN apt-get update && apt-get install -y ca-certificates curl && rm -rf /var/lib/apt/lists/*
  15. # Set working directory
  16. WORKDIR /app
  17. # Create upload directories
  18. RUN mkdir -p /app/uploaded/raw /app/uploaded/data
  19. # Copy compiled binary from build stage
  20. COPY --from=build /app/server /app/server
  21. # Set execute permissions
  22. RUN chmod +x /app/server
  23. # Expose port
  24. EXPOSE 8080
  25. # Start server
  26. CMD ["/app/server"]