forked from DIGI-UW/sedish
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (28 loc) · 1.53 KB
/
Copy pathDockerfile
File metadata and controls
35 lines (28 loc) · 1.53 KB
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
ARG PLATFORM_VERSION=latest
FROM jembi/platform:$PLATFORM_VERSION
ADD . /implementation
# ADD ./utils /instant/utils
# Create a directory in the image to store provided certificates
RUN mkdir -p /opt/certs/
# Mount the fullchain certificate secret and copy it to /opt/certs/
# The secret 'fullchain' will be provided during the 'docker build' command.
# Handle missing certificates gracefully for CI builds
RUN --mount=type=secret,id=fullchain,target=/tmp/fullchain.pem \
if [ -f /tmp/fullchain.pem ]; then \
cp /tmp/fullchain.pem /opt/certs/fullchain.pem && chmod 644 /opt/certs/fullchain.pem; \
else \
echo "Warning: fullchain.pem secret not provided, creating placeholder" && \
echo "# Placeholder certificate file" > /opt/certs/fullchain.pem && chmod 644 /opt/certs/fullchain.pem; \
fi
# Mount the private key secret and copy it to /opt/certs/
# The secret 'privkey' will be provided during the 'docker build' command.
# Handle missing certificates gracefully for CI builds
RUN --mount=type=secret,id=privkey,target=/tmp/privkey.pem \
if [ -f /tmp/privkey.pem ]; then \
cp /tmp/privkey.pem /opt/certs/privkey.pem && chmod 600 /opt/certs/privkey.pem; \
else \
echo "Warning: privkey.pem secret not provided, creating placeholder" && \
echo "# Placeholder private key file" > /opt/certs/privkey.pem && chmod 600 /opt/certs/privkey.pem; \
fi
RUN chmod +x /implementation/scripts/cmd/override-configs/override-configs
RUN /implementation/scripts/cmd/override-configs/override-configs