-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile-slim
41 lines (27 loc) · 1.17 KB
/
Dockerfile-slim
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
40
41
FROM debian:stable-slim
ARG TARGETPLATFORM
ARG TARGETARCH
ARG CARBONE_VERSION="4.25.0"
WORKDIR /tmp
RUN apt update && \
apt install -y libfreetype6 fontconfig libgssapi-krb5-2 fonts-dejavu-core && \
rm -rf /var/lib/apt/lists/*
# Create Carbone user
RUN adduser carbone --home /app --no-create-home --disabled-password --system
# Copy the local binary into the image folder "app"
ENV APP_ROOT=/app/
RUN mkdir ${APP_ROOT} && chown -R carbone:nogroup ${APP_ROOT}
WORKDIR ${APP_ROOT}
ADD --chown=carbone:nogroup --chmod=755 https://bin.carbone.io/carbone/carbone-ee-${CARBONE_VERSION}-linux-${TARGETARCH/amd64/x64} ./carbone-ee-linux
COPY --chown=carbone:nogroup --chmod=755 ./docker-entrypoint.sh ./docker-entrypoint.sh
# Include plugins
COPY --chown=carbone:nogroup ./carbone-ee-plugin-s3 /app/plugin-s3/
COPY --chown=carbone:nogroup ./carbone-ee-plugin-azure-storage-blob /app/plugin-azure/
# Include basic fonts
COPY --chown=carbone:nogroup fonts /usr/share/fonts/
RUN fc-cache -f -v
USER carbone
RUN mkdir /app/template && mkdir /app/render && mkdir /app/config && mkdir /app/asset && mkdir /app/plugin
EXPOSE 4000/tcp
ENTRYPOINT ["./docker-entrypoint.sh"]
CMD ["webserver"]