using composer for docker secure
This commit is contained in:
@@ -1,2 +1,4 @@
|
||||
.env
|
||||
.*swp
|
||||
id_ed25519
|
||||
id_ed25519.pub
|
||||
|
||||
+8
-6
@@ -37,15 +37,17 @@ RUN addgroup -g 1000 ${LOCALGROUP} \
|
||||
&& adduser --system --uid 1000 --ingroup ${LOCALGROUP} swsuser
|
||||
WORKDIR /home/swsuser
|
||||
COPY --chown=swsuser:${LOCALGROUP} git2zola.sh /home/swsuser/
|
||||
RUN chmod 777 git2zola.sh
|
||||
COPY --chown=swsuser:${LOCALGROUP} getOrCreateSshKeys.sh /home/swsuser/
|
||||
RUN chmod 777 git2zola.sh && chmod 777 getOrCreateSshKeys.sh
|
||||
USER swsuser
|
||||
# The RSA SHA-1 hash algorithm is being quickly deprecated across operating systems
|
||||
# https://www.openssh.com/txt/release-8.2
|
||||
RUN mkdir .ssh \
|
||||
&& chmod 700 .ssh \
|
||||
&& ssh-keygen -q -t ed25519 -C "swsuser@serinty.net" -f /home/swsuser/.ssh/id_ed25519 \
|
||||
&& echo "use this public key for git repo auth:" \
|
||||
&& cat /home/swsuser/.ssh/id_ed25519.pub
|
||||
#RUN mkdir .ssh \
|
||||
# && chmod 700 .ssh \
|
||||
# && ssh-keygen -q -t ed25519 -C "swsuser@serinty.net" -f /home/swsuser/.ssh/id_ed25519 \
|
||||
# && echo "use this public key for git repo auth:" \
|
||||
# && cat /home/swsuser/.ssh/id_ed25519.pub
|
||||
RUN /home/swsuser/getOrCreateSshKeys.sh
|
||||
RUN ls -la
|
||||
EXPOSE ${SWSPORT}
|
||||
ENTRYPOINT ["/usr/bin/env"]
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
#!/bin bash
|
||||
# ssh-keygen -q -t ed25519 -C "swsuser@serinty.net" -f ./id_ed25519
|
||||
#docker secret create id_ed25519 id_ed25519
|
||||
#docker secret create id_ed25519.pub id_ed25519.pub
|
||||
|
||||
export DOCKER_BUILDKIT=1
|
||||
#docker build --no-cache --progress=plain --tag sws4zola:latest .
|
||||
docker build --progress=plain --tag sws4zola:latest .
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
version: '3.3'
|
||||
services:
|
||||
sws4zola:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "8970"
|
||||
secrets:
|
||||
- id_ed25519
|
||||
- id_ed25519.pub
|
||||
environment:
|
||||
- GITPROJECTNAME=serinty-website
|
||||
- GITPROJECTUSER=Serinty
|
||||
- GITSERVER=gogs.serinty.net
|
||||
- GITSERVERPORT=22104
|
||||
- GITUSER=gogs
|
||||
- GITPASSWD=gogspw
|
||||
- LOCALUSER=swsuser
|
||||
- LOCALGROUP=swsgroup
|
||||
- SWSPORT=8970
|
||||
- GITTHEMENAME=serinty-zola-theme
|
||||
- THEME_NAME=serinty-theme
|
||||
- IDLE_TIME=86400
|
||||
|
||||
secrets:
|
||||
id_ed25519:
|
||||
file: ~/.ssh/id_ed25519
|
||||
id_ed25519.pub:
|
||||
file: ~/.ssh/id_ed25519.pub
|
||||
+4
-2
@@ -107,6 +107,8 @@ startSWSifNotRunning () {
|
||||
then
|
||||
echo "starting webserver"
|
||||
static-web-server --port ${SWSPORT} --log-level warn --root ~/${GITPROJECTNAME}/public/ &
|
||||
else
|
||||
echo "webserver is running"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -114,7 +116,7 @@ startSWSifNotRunning () {
|
||||
pullAndBuild () {
|
||||
echo "getting new data"
|
||||
git pull --ff-only
|
||||
echo "buid website"
|
||||
echo "buid website with newer data"
|
||||
zola build --base-url $BASE_URL --output-dir $OUTPUT_DIR
|
||||
}
|
||||
|
||||
@@ -140,7 +142,7 @@ getTheme () {
|
||||
echo "getting new design"
|
||||
git pull --ff-only
|
||||
cd ~/${GITPROJECTNAME}
|
||||
echo "buid website"
|
||||
echo "buid website with newer theme"
|
||||
zola build --base-url $BASE_URL --output-dir $OUTPUT_DIR
|
||||
fi
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user