Skip to content

Commit 7fcc4a7

Browse files
committed
cleanup
1 parent 5abb945 commit 7fcc4a7

File tree

5 files changed

+12
-135
lines changed

5 files changed

+12
-135
lines changed

Dockerfile

Lines changed: 0 additions & 39 deletions
This file was deleted.

docker-compose.yaml

Lines changed: 0 additions & 86 deletions
This file was deleted.

docker/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ ARG BUILD_DATE
1313

1414
ENV SUPPRESS_NO_CONFIG_WARNING=1
1515
ENV S6_FIX_ATTRS_HIDDEN=1
16+
ENV S6_BEHAVIOUR_IF_STAGE2_FAILS=1
1617
ENV NODE_ENV=production
1718

1819
RUN echo "fs.file-max = 65535" > /etc/sysctl.conf \
@@ -31,14 +32,16 @@ EXPOSE 80
3132
EXPOSE 81
3233
EXPOSE 443
3334

34-
COPY docker/rootfs /
3535
ADD backend /app
3636
ADD frontend/dist /app/frontend
3737
COPY global /app/global
3838

3939
WORKDIR /app
4040
RUN yarn install
4141

42+
# add late to limit cache-busting by modifications
43+
COPY docker/rootfs /
44+
4245
# Remove frontend service not required for prod, dev nginx config as well
4346
RUN rm -rf /etc/services.d/frontend RUN rm -f /etc/nginx/conf.d/dev.conf
4447

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
*
22
!.gitignore
3-
!01_envfile.sh
3+
!*.sh

docker/rootfs/etc/cont-init.d/01_envfile.sh renamed to docker/rootfs/etc/cont-init.d/01_s6-secret-init.sh

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
1-
#! /bin/bash
1+
#!/usr/bin/with-contenv bash
22
# ref: https://github.com/linuxserver/docker-baseimage-alpine/blob/master/root/etc/cont-init.d/01-envfile
33

44
# in s6, environmental variables are written as text files for s6 to monitor
55
# seach through full-path filenames for files ending in "__FILE"
66
for FILENAME in $(find /var/run/s6/container_environment/ | grep "__FILE$"); do
7-
echo "[secret-init] Evaluating ${FILENAME##*/}"
7+
echo "[secret-init] Evaluating ${FILENAME##*/} ..."
88

99
# set SECRETFILE to the contents of the full-path textfile
1010
SECRETFILE=$(cat ${FILENAME})
1111
# SECRETFILE=${FILENAME}
12-
echo "[secret-init] Setting SECRETFILE to ${SECRETFILE}..." # DEBUG - rm for prod!
12+
# echo "[secret-init] Set SECRETFILE to ${SECRETFILE}" # DEBUG - rm for prod!
1313

1414
# if SECRETFILE exists / is not null
1515
if [[ -f ${SECRETFILE} ]]; then
1616
# strip the appended "__FILE" from environmental variable name ...
1717
STRIPFILE=$(echo ${FILENAME} | sed "s/__FILE//g")
18-
echo "[secret-init] Set STRIPFILE to ${STRIPFILE}" # DEBUG - rm for prod!
18+
# echo "[secret-init] Set STRIPFILE to ${STRIPFILE}" # DEBUG - rm for prod!
1919

2020
# ... and set value to contents of secretfile
2121
# since s6 uses text files, this is effectively "export ..."
22-
# cat ${SECRETFILE} > ${STRIPFILE}
23-
cat $(${SECRETFILE} | sed "s/[^\w.-]+//g") > ${STRIPFILE}
24-
echo "[secret-init] Set ${STRIPFILE} to $(cat ${STRIPFILE})" # DEBUG - rm for prod!"
25-
echo "[secret-init] Success! ${STRIPFILE} set from ${FILENAME}"
22+
printf $(cat ${SECRETFILE}) > ${STRIPFILE}
23+
# echo "[secret-init] Set ${STRIPFILE##*/} to $(cat ${STRIPFILE})" # DEBUG - rm for prod!"
24+
echo "[secret-init] Success! ${STRIPFILE##*/} set from ${FILENAME##*/}"
2625

2726
else
2827
echo "[secret-init] cannot find secret in ${FILENAME}"

0 commit comments

Comments
 (0)