Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
FROM php:7.2-alpine
FROM php:7.4

LABEL maintainer="herloct <herloct@gmail.com>"

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

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"]
18 changes: 18 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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 "$@"