-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (30 loc) · 763 Bytes
/
Copy pathDockerfile
File metadata and controls
38 lines (30 loc) · 763 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
# Build stage
FROM rust:1.89-alpine as builder
# RUN apt-get update
# RUN apt-get install pkg-config libssl-dev -y
RUN apk add musl-dev
# Copy the source code
ADD . .
# Build the project
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/src/target \
cargo build --release
# Final stage
FROM alpine
ARG REF=""
ARG COMMIT=""
ARG TIME=""
ENV COMMIT=${COMMIT}
ENV REF=${REF}
ENV TIME=${TIME}
ENV CT=${CT}
ENV TZ="America/New_York"
# Copy the binary from the build stage
COPY --from=builder /target/release/www /usr/local/bin/www
COPY ./assets /usr/local/bin/assets
COPY ./content /usr/local/bin/content
COPY ./css /usr/local/bin/css
# Set the command to run the binary
WORKDIR /usr/local/bin
CMD ["www"]
EXPOSE 3000