-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathDockerfile.standalone
39 lines (36 loc) · 1.29 KB
/
Dockerfile.standalone
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
FROM rust:1.78-alpine3.20
ARG RELEASE=0.14.0
RUN apk --no-cache update && \
apk add --no-cache \
musl-dev \
sqlite-static \
upx && \
adduser -D rust
USER rust
WORKDIR /home/rust
# these avoid the overhead of compiling our own static library
ENV SQLITE3_STATIC=1 \
SQLITE3_LIB_DIR=/usr/lib
RUN wget -qO - https://github.com/PrivateBin/Directory/archive/${RELEASE}.tar.gz | tar -xz --strip 1 && \
cargo build --release && \
upx --ultra-brute target/release/directory
FROM scratch
ARG RELEASE=0.14.0
LABEL [email protected] \
org.opencontainers.image.vendor=PrivateBin \
org.opencontainers.image.documentation=https://github.com/PrivateBin/Directory/blob/master/README.md \
org.opencontainers.image.source=https://github.com/PrivateBin/Directory \
org.opencontainers.image.licenses=AGPL-3.0 \
org.opencontainers.image.version=${RELEASE}
ENV GEOIP_MMDB=/var/geoip-country.mmdb \
ROCKET_ADDRESS="::" \
ROCKET_DATABASES={directory={url="/var/directory.sqlite"}}
EXPOSE 8000
USER 1000:1000
WORKDIR /
VOLUME /var
CMD ["directory"]
COPY --from=0 /home/rust/css /css
COPY --from=0 /home/rust/img /img
COPY --from=0 /home/rust/target/release/directory /bin/
COPY --from=0 /home/rust/templates /templates