0
0
Fork 0
mirror of https://git.verdigado.com/NB-Public/simple-wkd.git synced 2024-12-06 14:52:41 +01:00

Switch back to alpine for docker, statically linked OpenSSL

This commit is contained in:
Delta1925 2023-04-17 15:27:15 +02:00
parent ca8bcfaa96
commit 344a31860a
No known key found for this signature in database
GPG key ID: 1C21ACE44193CB25
3 changed files with 30 additions and 159 deletions

View file

@ -1,13 +1,14 @@
FROM rust:1.68 AS bin-builder
FROM rust:1.68-alpine3.17 AS bin-builder
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install clang nettle-dev pkg-config libssl-dev -y
COPY backend .
RUN cargo build --release
RUN apk add --no-cache openssl-dev openssl-libs-static musl-dev
RUN export OPENSSL_STATIC=1 && \
export OPENSSL_LIB_DIR=/usr/lib &&\
export OPENSSL_INCLUDE_DIR=/usr/include/openssl && \
cargo build --release
FROM node:19 AS webpage-builder
FROM node:19-alpine3.17 AS webpage-builder
COPY website .
RUN npm install -g pnpm && \
@ -17,16 +18,11 @@ COPY assets assets
RUN mv dist assets/webpage
FROM debian:bullseye-slim
FROM alpine:3.17
WORKDIR /wkd
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install ca-certificates -y && \
rm -rf /var/lib/apt/lists/* && \
adduser --no-create-home wkd && \
chown -R wkd:wkd /wkd && \
chmod -R 777 /wkd
RUN adduser --no-create-home --disabled-password wkd && \
chown -R wkd:wkd /wkd
USER wkd
COPY --from=webpage-builder assets assets
COPY --from=bin-builder target/release/simple-wkd wkd