-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c533f9b
commit b1dd619
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# We use the latest Rust stable release as base image | ||
FROM rust:1.77.2 as builder | ||
|
||
WORKDIR /app | ||
# Install the required system dependencies for our linking configuration | ||
# Copy all files from our working environments to our Docker image | ||
# Build binary! | ||
# Using release profile to make it fast | ||
RUN apt update && apt install lld clang -y && \ | ||
COPY . . && \ | ||
ENV SQLX_OFFLINE true && \ | ||
cargo build --release | ||
|
||
# Use a smaller base image for the final image | ||
FROM debian:buster-slim | ||
WORKDIR /app | ||
COPY --from=builder /app/target/release/newsletter /app/newsletter | ||
# When `docker run` is executed, launch the binary! | ||
ENTRYPOINT [ "./newsletter" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: '3.8' | ||
services: | ||
newsletter: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
volumes: | ||
- .:/app | ||
ports: | ||
- "8000:8000" |