Skip to content

Commit

Permalink
Cleanup docker
Browse files Browse the repository at this point in the history
  • Loading branch information
wereii committed Jun 25, 2024
1 parent 9771dfb commit 0ca15d0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
target
.github
.vscode
.idea
16 changes: 6 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1.6
ARG RUST_VERSION=1.76
ARG RUST_VERSION=1.79
ARG CARGO_BUILD_FEATURES=default
ARG RUST_RELEASE_MODE=debug

Expand Down Expand Up @@ -40,19 +40,17 @@ RUN --mount=type=cache,target=/lemmy-thumbnail-cleaner/target set -ex; \
# amd64 base runner
FROM ${AMD_RUNNER_IMAGE} AS runner-linux-amd64

# Add system packages that are needed: federation needs CA certificates, curl can be used for healthchecks
RUN apt update && apt install -y libssl-dev libpq-dev ca-certificates curl
# libpq-dev is required for the postgresql client, others are kept for the possible ssl support
RUN apt update && apt install -y libpq-dev ca-certificates libssl-dev

COPY --from=build-amd64 --chmod=0755 /lemmy/lemmy-thumbnail-cleaner /usr/local/bin


# Final image that use a base runner based on the target OS and ARCH
FROM runner-${TARGETOS}-${TARGETARCH}

#LABEL org.opencontainers.image.authors="The Lemmy Authors"
#LABEL org.opencontainers.image.source="https://github.com/LemmyNet/lemmy"
#LABEL org.opencontainers.image.licenses="AGPL-3.0-or-later"
#LABEL org.opencontainers.image.description="A link aggregator and forum for the fediverse"
LABEL org.opencontainers.image.source="https://github.com/wereii/lemmy-thumbnail-cleaner"
LABEL org.opencontainers.image.licenses="MIT"

ARG UNAME
ARG GID
Expand All @@ -62,6 +60,4 @@ RUN groupadd -g ${GID} -o ${UNAME} && \
useradd -m -u ${UID} -g ${GID} -o -s /bin/bash ${UNAME}
USER $UNAME

ENTRYPOINT ["lemmy-thumbnail-cleaner"]
EXPOSE 8536
STOPSIGNAL SIGTERM
ENTRYPOINT ["lemmy-thumbnail-cleaner"]

0 comments on commit 0ca15d0

Please sign in to comment.