-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (33 loc) · 1003 Bytes
/
Dockerfile
File metadata and controls
44 lines (33 loc) · 1003 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
40
41
42
43
44
# Use the official Rust image as the base image for building
FROM rust:1.75-slim-bullseye AS builder
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && \
apt-get install -y \
pkg-config \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy the entire project
COPY . .
# Build the application in release mode
RUN cargo build --release
# Create a minimal runtime image
FROM debian:bullseye-slim
# Install runtime dependencies
RUN apt-get update && \
apt-get install -y \
ca-certificates \
libssl1.1 \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy the built binary from the builder stage
COPY --from=builder /app/target/release/youtube-lookup .
# Copy the static HTML file
# Adjust the path if your HTML file is in a different location
COPY --from=builder /app/static/index.html ./static/index.html
# Expose the port the app runs on
EXPOSE 3000
# Set the startup command
CMD ["./youtube-lookup"]