programm-webhook/Dockerfile

32 lines
775 B
Docker

FROM nginx
# Install git and ssh-keygen
RUN apt-get update && \
apt-get install -y git openssh-client && \
rm -rf /var/lib/apt/lists/*
# Set the path to the SSH key pair
ENV SSH_KEY_PATH=/root/.ssh/id_ed25519
# Check if the SSH key pair exists
RUN if [ ! -f "$SSH_KEY_PATH" ]; then \
ssh-keygen -t ed25519 -N "" -f $SSH_KEY_PATH && \
echo "Generated SSH key pair:" && \
cat $SSH_KEY_PATH.pub; \
else \
echo "Using existing SSH key pair:" && \
cat $SSH_KEY_PATH.pub; \
fi
# Nginx configuration
COPY nginx.conf.dist /etc/nginx/nginx.conf
# Entrypoint.sh
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
# Expose ports
EXPOSE 80
EXPOSE 443
# Fetch repo
CMD ["entrypoint.sh"]