2021-06-01 10:33:58 +08:00
|
|
|
FROM alpine
|
|
|
|
LABEL maintainer="zhenorzz@gmail.com"
|
2021-11-09 14:12:28 +08:00
|
|
|
ARG GOPLOY_VER=v1.3.7
|
2021-06-01 10:33:58 +08:00
|
|
|
ENV GOPLOY_VER=${GOPLOY_VER}
|
|
|
|
|
|
|
|
ENV MYSQL_PORT=3306
|
|
|
|
|
|
|
|
RUN echo "http://mirrors.aliyun.com/alpine/latest-stable/main/" > /etc/apk/repositories
|
|
|
|
RUN echo "http://mirrors.aliyun.com/alpine/latest-stable/community/" >> /etc/apk/repositories
|
|
|
|
|
|
|
|
#install
|
|
|
|
RUN apk update && \
|
|
|
|
apk add --no-cache \
|
|
|
|
openssh-client \
|
|
|
|
ca-certificates \
|
|
|
|
bash \
|
|
|
|
git \
|
|
|
|
rsync \
|
|
|
|
&& rm -rf /var/cache/apk/*
|
|
|
|
|
|
|
|
#git
|
|
|
|
RUN git config --global pull.rebase false
|
|
|
|
|
|
|
|
#goploy
|
|
|
|
ADD https://github.com/zhenorzz/goploy/releases/download/${GOPLOY_VER}/goploy /opt/goploy/
|
|
|
|
RUN chmod a+x /opt/goploy/goploy
|
|
|
|
|
|
|
|
EXPOSE 80
|
|
|
|
|
|
|
|
VOLUME ["/opt/goploy/repository/"]
|
|
|
|
|
|
|
|
ENTRYPOINT \
|
|
|
|
echo 'DB_TYPE=mysql' > /opt/goploy/.env;\
|
2021-10-28 11:39:21 +08:00
|
|
|
echo "DB_CONN=${MYSQL_USER}:${MYSQL_PASSWORD}@(${MYSQL_HOST}:${MYSQL_PORT})/goploy?charset=utf8" >> /opt/goploy/.env;\
|
2021-06-01 10:33:58 +08:00
|
|
|
echo 'SIGN_KEY=please-study-jwt' >> /opt/goploy/.env;\
|
|
|
|
echo 'LOG_PATH=stdout' >> /opt/goploy/.env;\
|
|
|
|
echo 'ENV=production' >> /opt/goploy/.env;\
|
|
|
|
echo 'PORT=80' >> /opt/goploy/.env;\
|
|
|
|
/opt/goploy/goploy
|