-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (33 loc) · 1.36 KB
/
Dockerfile
File metadata and controls
44 lines (33 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# =============================================================================
# StatusPost - Multi-stage Docker Build
# =============================================================================
# Uses ARO buildsystem to compile, then ARO runtime to execute
# =============================================================================
# -----------------------------------------------------------------------------
# Stage 1: Build
# -----------------------------------------------------------------------------
FROM ghcr.io/arolang/aro-buildsystem:latest AS builder
WORKDIR /app
# Copy application source files
COPY *.aro ./
COPY openapi.yaml ./
COPY templates/ ./templates/
# Compile to native binary
RUN aro build . --optimize
# -----------------------------------------------------------------------------
# Stage 2: Runtime
# -----------------------------------------------------------------------------
FROM ghcr.io/arolang/aro-runtime:latest
WORKDIR /app
# Copy compiled binary from builder
COPY --from=builder /app/app ./app
# Copy runtime assets (templates, openapi spec)
COPY --from=builder /app/openapi.yaml ./
COPY --from=builder /app/templates/ ./templates/
# Expose HTTP port
EXPOSE 8080
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8080/ || exit 1
# Run the application
CMD ["./app"]