diff options
| author | MohamedBassem <me@mbassem.com> | 2024-07-21 21:28:52 +0000 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2024-07-21 21:28:53 +0000 |
| commit | 98fc5598a82c9015fa8e4f84a8bc4d59af1f0b21 (patch) | |
| tree | 80e6f2b6f4e0f2b9b39db7f3bbc6f604dd7281e3 /docker/Dockerfile | |
| parent | c5c62de28944077004f01960ee9f7e12b7d26c2c (diff) | |
| download | karakeep-98fc5598a82c9015fa8e4f84a8bc4d59af1f0b21.tar.zst | |
build: Add an all-in-one container
Diffstat (limited to 'docker/Dockerfile')
| -rw-r--r-- | docker/Dockerfile | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/docker/Dockerfile b/docker/Dockerfile index 95d23f8d..592c4cfd 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -111,3 +111,37 @@ ARG SERVER_VERSION=nightly ENV SERVER_VERSION=${SERVER_VERSION} ENTRYPOINT ["node", "index.mjs"] + + +################# All-in-one ############## + +# Start from the web container as its the one with the most configuration +FROM web AS aio + +WORKDIR /app + +ARG S6_OVERLAY_VERSION=3.2.0.0 +ARG TARGETARCH + +# Install s6-overlay +ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp +RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz +RUN case ${TARGETARCH} in \ + "amd64") S6_ARCH=x86_64 ;; \ + "arm64") S6_ARCH=aarch64 ;; \ + esac \ + && echo https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_ARCH}.tar.xz -O /tmp/s6-overlay-${S6_ARCH}.tar.xz \ + && wget https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-${S6_ARCH}.tar.xz -O /tmp/s6-overlay-${S6_ARCH}.tar.xz \ + && tar -C / -Jxpf /tmp/s6-overlay-${S6_ARCH}.tar.xz \ + && rm -f /tmp/s6-overlay-${S6_ARCH}.tar.xz + +# Install runtime deps +RUN apk add --no-cache monolith + +# Copy workers code +COPY --from=workers_builder /prod /app/apps/workers +RUN corepack enable + +COPY --chmod=755 ./docker/root/etc/s6-overlay /etc/s6-overlay + +ENTRYPOINT ["/init"] |
