37 lines
879 B
Docker
37 lines
879 B
Docker
FROM golang:1.18.2
|
|
|
|
WORKDIR /gogs_runner
|
|
|
|
COPY . .
|
|
|
|
RUN go build
|
|
|
|
FROM python:3.7
|
|
|
|
LABEL maintainer="zhaoyingbo@live.cn"
|
|
|
|
EXPOSE 3001
|
|
|
|
WORKDIR /gogs_runner
|
|
|
|
ENV GOGS_REPOSITORY '/gogs_runner/repository/'
|
|
|
|
HEALTHCHECK --interval=5s --timeout=3s \
|
|
CMD curl -fs http://0.0.0.0:3001/health || exit 1
|
|
|
|
RUN echo "[]" > config.json
|
|
|
|
RUN mkdir .log
|
|
|
|
RUN mkdir repository
|
|
|
|
RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list \
|
|
&& sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list \
|
|
&& apt-get update && apt-get install -y --no-install-recommends procps wget vim curl \
|
|
&& apt-get install -y --no-install-recommends libsm6 libxrender1 libxext-dev libglib2.0-dev \
|
|
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
|
|
|
COPY --from=0 /gogs_runner/gogs_runner gogs_runner
|
|
|
|
CMD /bin/bash -c /gogs_runner/gogs_runner
|