hummingbird-core.dockerfile 540 B

1234567891011121314151617181920212223242526272829
  1. # ================================
  2. # Build image
  3. # ================================
  4. FROM swift:5.7 as build
  5. WORKDIR /build
  6. # Copy entire repo into container
  7. COPY ./src .
  8. # Compile with optimizations
  9. RUN swift build \
  10. -c release \
  11. -Xswiftc -enforce-exclusivity=unchecked
  12. # ================================
  13. # Run image
  14. # ================================
  15. FROM swift:5.7-slim
  16. WORKDIR /run
  17. # Copy build artifacts
  18. COPY --from=build /build/.build/release /run
  19. ENV SERVER_PORT=8080
  20. ENV SERVER_HOSTNAME=0.0.0.0
  21. EXPOSE 8080
  22. CMD ["./server"]