Files
staticzolaserver-docker/Dockerfile
T

55 lines
2.1 KiB
Docker

# syntax=docker/dockerfile:1.2
# staic webserver with zola
# https://github.com/joseluisq/static-web-server
# https://github.com/static-web-server/static-web-server
# https://gitlab.alpinelinux.org/alpine/docker-abuild/-/blob/master/entrypoint.sh
FROM joseluisq/static-web-server:2-alpine
MAINTAINER serinty.net
RUN apk upgrade --update-cache --available
RUN apk add --no-cache git openssh-client openssh-keygen bash
RUN apk add --no-cache zola --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/
ARG GITPROJECTNAME=serinty-website
ENV GITPROJECTNAME=${GITPROJECTNAME}
ARG GITPROJECTUSER=Serinty
ENV GITPROJECTUSER=${GITPROJECTUSER}
ARG GITSERVER=gogs.serinty.net
ENV GITSERVER=${GITSERVER}
ARG GITSERVERPORT=22104
ENV GITSERVERPORT=${GITSERVERPORT}
ARG GITUSER=gogs
ENV GITUSER=${GITUSER}
ARG GITPASSWD=gogspw
ENV GITPASSWD=${GITPASSWD}
ARG LOCALUSER=swsuser
ENV LOCALUSER=${LOCALUSER}
ARG LOCALGROUP=swsgroup
ENV LOCALGROUP=${LOCALGROUP}
ARG SWSPORT=8970
ENV SWSPORT=${SWSPORT}
# ssh forwarding dosen't work, no --secret option is working
#RUN echo "Host *" >> /etc/ssh/ssh_config
#RUN echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config
#RUN cat ~/.ssh/known_hosts
#RUN cat /etc/ssh/ssh_config
#RUN --mount=type=ssh ssh-add -L
#RUN --mount=type=ssh git clone -v ${GITCLONEURL}
RUN addgroup -g 1000 ${LOCALGROUP} \
&& adduser --system --uid 1000 --ingroup ${LOCALGROUP} swsuser
WORKDIR /home/swsuser
COPY --chown=swsuser:${LOCALGROUP} git2zola.sh /home/swsuser/
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 /home/swsuser/getOrCreateSshKeys.sh
RUN ls -la
EXPOSE ${SWSPORT}
ENTRYPOINT ["/usr/bin/env"]
CMD ["/home/swsuser/git2zola.sh"]