-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (21 loc) · 701 Bytes
/
Dockerfile
File metadata and controls
29 lines (21 loc) · 701 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
# Use the official Rust image as the base image
FROM rust:latest as builder
# Set the working directory in the container
WORKDIR /app
# Copy all the needed files to build the application
COPY Cargo.toml Cargo.lock diesel.toml db.sqlite ./
COPY src ./src
# Build the Rust application
RUN cargo build --release
# Start with a minimal image to reduce size
FROM rust:latest
# Set the working directory in the container
WORKDIR /app
# Copy the built binary from the builder stage
COPY --from=builder /app/target/release/tedtalk .
COPY --from=builder /app/diesel.toml .
COPY --from=builder /app/db.sqlite .
# Expose any necessary ports
EXPOSE 3000
# Command to run the application
CMD ["./tedtalk"]