diff --git a/Dockerfile b/Dockerfile index 0785d09..34a10d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,10 @@ -FROM php:7.2-alpine +FROM php:7.4 LABEL maintainer="herloct " -ENV DEPLOYER_VERSION=6.3.0 +ENV DEPLOYER_VERSION=6.8.0 -RUN apk update --no-cache \ - && apk add --no-cache \ - openssh-client +RUN apt-get update && apt-get install -y openssh-client rsync RUN curl -L https://deployer.org/releases/v$DEPLOYER_VERSION/deployer.phar > /usr/local/bin/deployer \ && chmod +x /usr/local/bin/deployer @@ -14,5 +12,7 @@ RUN curl -L https://deployer.org/releases/v$DEPLOYER_VERSION/deployer.phar > /us VOLUME ["/project", "$HOME/.ssh"] WORKDIR /project -ENTRYPOINT ["deployer"] +COPY docker-entrypoint.sh /bin/docker-entrypoint.sh +RUN chmod +x /bin/docker-entrypoint.sh +ENTRYPOINT ["/bin/docker-entrypoint.sh"] CMD ["--version"] diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100644 index 0000000..7f2c76e --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,18 @@ +#!/bin/sh +set -e + +if [ -d /tmp/.ssh ]; then + cp -R /tmp/.ssh /root/.ssh + chmod 700 /root/.ssh + if [ -f /root/.ssh/id_rsa.pub ]; then + chmod 644 /root/.ssh/id_rsa.pub + fi + if [ -f /root/.ssh/id_rsa.pub ]; then + chmod 600 /root/.ssh/id_rsa + fi + if [ -f /root/.ssh/config ]; then + chmod 600 /root/.ssh/config + fi +fi + +deployer "$@" \ No newline at end of file