d6f5bf2e38
--- type: change message: rename http-server to dehub-remote change_hash: AJr5PxENqy2UgmM7a4OZ/lse0vEEQ0pTp/2iOi0mlF0a credentials: - type: pgp_signature pub_key_id: 95C46FA6A41148AC body: iQIzBAABAgAdFiEEJ6tQKp6olvZKJ0lwlcRvpqQRSKwFAl59ceYACgkQlcRvpqQRSKxq8w/+J5xX2clHt/P/nc3e0dsFVLr/O3FB0J1m5x1fpLFMeZyWPjmbfCX30KrB/decyzGg7BFLYSbbCysMP2ZQt7bar1zDHN0vR5Isdv1Ru71uLKHeP65EW8fmm0DmDcCzJrFvveAfzgNm5gi8a3dEYCNTWUL8v7s/AhpQI/w7PGIOM+xEH2KFpaEEwAT20BAJI+SiTRW1/LxXocjYF4YvHHZGOCH6TESC8urLNDvfk54ayPRe6FOYLVhXXNRBm4Lv8vF9Yora1h6QG3mhzEzIVnRv+4/7xBOS5azIWpSo0MSdVLRmiae8jEYU0YCRixhIheiI2M664okCmOdVFNlGEbp5e1SmHzMdPONaOqN+LHRakwBEuVClpanZPRvFd3It0OtoLxiS/nJ17gzNQnPrqsNBYK35y3HowzLYe0zZDJZpYdIh0q06JFXew09ogW9Am35Mt+fZ8GTQFC9AR990umwCXaZ9WUq/Vc0i1SbsTFLyBTOabt+OdqnLTefF6bs5q5RyzETwcenJBusvjwOV0UHNTbUaE427wVCY2UupZAd6Sn1krdZvWvqq/oqJ6GKfRhmTA3X2UjSApI04CBGjbsfQ1o5wZnF+fKuwOO77rDTMNgbnmA5wxlaYlJ92WQXVKSlqCryqGc2joHkeWDablEV44ayGpDaGS1LUP2kAl3YM45c= account: mediocregopher
47 lines
1.5 KiB
Docker
47 lines
1.5 KiB
Docker
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 .
|
|
|
|
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
|
|
|
|
# Copy binaries
|
|
COPY --from=0 /usr/bin/dehub /usr/bin/dehub
|
|
COPY --from=0 /usr/bin/git-http-server /usr/bin/git-http-server
|
|
|
|
# Create config files for container startup and nginx
|
|
COPY cmd/dehub-remote/nginx.conf /etc/nginx/nginx.conf
|
|
|
|
# Create pre-receive
|
|
COPY cmd/dehub-remote/pre-receive /pre-receive
|
|
|
|
# Create start.sh
|
|
COPY cmd/dehub-remote/start.sh /start.sh
|
|
RUN chmod +x /start.sh
|
|
|
|
ENTRYPOINT ["/start.sh"]
|