You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.4 KiB
44 lines
1.4 KiB
![]()
4 years ago
|
FROM golang:1.14
|
||
|
WORKDIR /go/src/dehub
|
||
|
COPY . .
|
||
|
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /usr/bin/dehub ./cmd/dehub
|
||
|
|
||
|
WORKDIR /go/src/dehub/cmd/git-http-server
|
||
|
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /usr/bin/git-http-server .
|
||
|
|
||
![]()
4 years ago
|
FROM debian:jessie
|
||
|
|
||
|
# Setup Container
|
||
|
VOLUME ["/repos"]
|
||
|
EXPOSE 80
|
||
|
|
||
|
# Setup APT
|
||
|
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
|
||
|
|
||
|
# Update, Install Prerequisites, Clean Up APT
|
||
|
RUN DEBIAN_FRONTEND=noninteractive apt-get -y update && \
|
||
|
apt-get -y install git wget nginx-full fcgiwrap && \
|
||
|
apt-get clean
|
||
|
|
||
|
# Setup Container User
|
||
|
RUN useradd -M -s /bin/false git --uid 1000
|
||
|
|
||
|
# Setup nginx fcgi services to run as user git, group git
|
||
|
RUN sed -i 's/FCGI_USER="www-data"/FCGI_USER="git"/g' /etc/init.d/fcgiwrap && \
|
||
|
sed -i 's/FCGI_GROUP="www-data"/FCGI_GROUP="git"/g' /etc/init.d/fcgiwrap && \
|
||
|
sed -i 's/FCGI_SOCKET_OWNER="www-data"/FCGI_SOCKET_OWNER="git"/g' /etc/init.d/fcgiwrap && \
|
||
|
sed -i 's/FCGI_SOCKET_GROUP="www-data"/FCGI_SOCKET_GROUP="git"/g' /etc/init.d/fcgiwrap
|
||
|
|
||
![]()
4 years ago
|
# Copy binaries
|
||
|
COPY --from=0 /usr/bin/dehub /usr/bin/dehub
|
||
|
COPY --from=0 /usr/bin/git-http-server /usr/bin/git-http-server
|
||
|
|
||
![]()
4 years ago
|
# Create config files for container startup and nginx
|
||
![]()
4 years ago
|
COPY cmd/dehub-remote/nginx.conf /etc/nginx/nginx.conf
|
||
![]()
4 years ago
|
|
||
|
# Create start.sh
|
||
![]()
4 years ago
|
COPY cmd/dehub-remote/start.sh /start.sh
|
||
![]()
4 years ago
|
RUN chmod +x /start.sh
|
||
|
|
||
|
ENTRYPOINT ["/start.sh"]
|