-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (27 loc) · 721 Bytes
/
Dockerfile
File metadata and controls
39 lines (27 loc) · 721 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
38
39
# Build stage
FROM rust:1.75 as builder
WORKDIR /app
# Copy manifests
COPY Cargo.toml Cargo.lock ./
# Copy source code
COPY src ./src
COPY templates ./templates
# Build the application
RUN cargo build --release
# Runtime stage
FROM debian:bookworm-slim
WORKDIR /app
# Install required runtime dependencies
RUN apt-get update && apt-get install -y \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Bind to all interfaces inside containers.
ENV BIND_ADDR=0.0.0.0:3000
# Copy the binary from builder
COPY --from=builder /app/target/release/poem-oai /app/poem-oai
# Copy templates
COPY templates ./templates
# Expose the port the app runs on
EXPOSE 3000
# Set the startup command
CMD ["/app/poem-oai"]