-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (26 loc) · 894 Bytes
/
Dockerfile
File metadata and controls
37 lines (26 loc) · 894 Bytes
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
FROM rust:alpine AS builder
# Arguments
ARG CURRENT_COMMIT
ARG CURRENT_BUILD
# Set the working directory
WORKDIR /usr/src/app
COPY . .
# Install necessary build dependencies, including protobuf compiler
RUN apk add --no-cache musl-dev openssl-dev protobuf-dev
# Compile the controller with the wasm-plugins feature
RUN cargo build -p controller --features wasm-plugins --release
# Runtime stage: Use a minimal Alpine image
FROM alpine:latest
# Install necessary runtime dependencies
RUN apk add --no-cache curl unzip openjdk21-jre
# Set the working directory
WORKDIR /app
# Copy entrypoint script
COPY .github/docker/entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
# Copy the controller binary from the builder stage
COPY --from=builder /usr/src/app/target/release/controller /app/controller
# Expose the port
EXPOSE 8080
# Run the controller
CMD ["./entrypoint.sh"]