-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (28 loc) · 1015 Bytes
/
Dockerfile
File metadata and controls
37 lines (28 loc) · 1015 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
FROM debian:13 AS build
RUN apt-get update && apt-get install -y curl build-essential pkg-config libssl-dev cmake && rm -rf /var/lib/apt/lists/*
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH=/root/.cargo/bin:$PATH
RUN mkdir /app
RUN --mount=type=bind,source=Cargo.toml,target=/app/Cargo.toml \
--mount=type=bind,source=Cargo.lock,target=/app/Cargo.lock \
--mount=type=bind,source=src,target=/app/src \
cd /app && cargo build --release
##### Production image
FROM debian:13-slim
RUN <<EOT
groupadd -r app
useradd -r -d /app -g app -N app
EOT
RUN <<EOT
apt-get clean
apt update && apt install xmlsec1 redis ca-certificates curl -y
apt dist-upgrade -y
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
EOT
# Copy from the build container
COPY --from=build --chown=app:app /app/target/release/inmor /app/
COPY --from=build --chown=app:app /app/target/release/inmor-collection /app/
COPY --chown=app:app templates/ /app/templates/
USER app
WORKDIR /app
EXPOSE 8080