From ca8bcfaa96aad50d9f8905c5b43a940e4c982807 Mon Sep 17 00:00:00 2001 From: Delta1925 Date: Sun, 16 Apr 2023 22:20:45 +0200 Subject: [PATCH] Return to debian for docker --- .gitignore | 1 + Dockerfile | 23 +++++++++++-------- backend/.gitignore | 3 +-- backend/src/settings.rs | 1 + ...example.config.toml => example.config.toml | 0 5 files changed, 17 insertions(+), 11 deletions(-) create mode 100644 .gitignore rename backend/example.config.toml => example.config.toml (100%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ab8b69c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +config.toml \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index b3d1533..1c38abd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,13 @@ -FROM rust:1.68-alpine3.17 AS bin-builder +FROM rust:1.68 AS bin-builder -COPY backend backend -COPY Cargo.lock . -COPY Cargo.toml . -RUN apk add --no-cache openssl-dev musl-dev +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 -FROM node:19-alpine3.17 AS webpage-builder +FROM node:19 AS webpage-builder COPY website . RUN npm install -g pnpm && \ @@ -17,11 +17,16 @@ COPY assets assets RUN mv dist assets/webpage -FROM alpine:3.17 +FROM debian:bullseye-slim WORKDIR /wkd -RUN adduser --no-create-home --disabled-password wkd && \ - chown -R wkd:wkd /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 USER wkd COPY --from=webpage-builder assets assets COPY --from=bin-builder target/release/simple-wkd wkd diff --git a/backend/.gitignore b/backend/.gitignore index 3f165c7..8279dd9 100644 --- a/backend/.gitignore +++ b/backend/.gitignore @@ -1,4 +1,3 @@ /target /data -/logs -config.toml \ No newline at end of file +/logs \ No newline at end of file diff --git a/backend/src/settings.rs b/backend/src/settings.rs index bb50cc0..3429d7e 100644 --- a/backend/src/settings.rs +++ b/backend/src/settings.rs @@ -85,6 +85,7 @@ fn get_mailer() -> SmtpTransport { .credentials(creds) .port(SETTINGS.mail_settings.smtp_port) .build(); + debug!("Checking connection..."); if mailer.test_connection().is_err() { warn!("Connection test to smtp host failed!"); } diff --git a/backend/example.config.toml b/example.config.toml similarity index 100% rename from backend/example.config.toml rename to example.config.toml