-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (21 loc) · 725 Bytes
/
Dockerfile
File metadata and controls
31 lines (21 loc) · 725 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
# Use Rust official image as base
FROM rust:latest as builder
# Set the working directory inside the container
WORKDIR /app
# Copy the project files into the container
COPY . .
# Build the project
RUN cargo build --release
# Start a new stage and use Ubuntu base image
FROM ubuntu:latest
# Set the working directory inside the container
WORKDIR /app
# Install libsqlite3-dev and other dependencies
RUN apt-get update && \
apt-get install -y libsqlite3-dev
# Copy the built binary from the builder stage into the current stage
COPY --from=builder /app/target/release/pastry_crust .
# Expose the port that the application will run on
EXPOSE 8080
# Define the command to run the application
CMD ["./pastry_crust"]