dehub/Dockerfile
mediocregopher a3b98cc4ef move Dockerfile into the root, make it build git-http-server as well
---
type: change
message: move Dockerfile into the root, make it build git-http-server as well
change_hash: AMsTQSEBo/XDnbkuiSStDsWUdian3UXM5YXlMhvTlegk
credentials:
- type: pgp_signature
  pub_key_id: 95C46FA6A41148AC
  body: iQIzBAABAgAdFiEEJ6tQKp6olvZKJ0lwlcRvpqQRSKwFAl59b6MACgkQlcRvpqQRSKzD0g//Qja8EIF/cdOz5OrqdXOJeUqUm2QfZuUrDANZey3rTtpULAy3OTezrSTEK//bd+DLa+hf9r0hTocCzhTx5RO6wKYup0LMdiO6QGeXhdKzVjuN0FA7jQztjgZD5Y/P+PT9Ye8NiCPrQ8gdtG3BRB5RDgHILQNclvt5GyKMske4rYbi99DtnrSbbqP0n7dZLaurAkP7fQL2Q+8/o8Vt+uAl8s2whMJ1z7+Z8YqN+uUcHfuTxEcBkW97qjsjhpk9ZVSzpw6GXjuFy/n9uBk2mVyaoMcKtk03SCB7byCK7uM3mNMakr+m2W+RQMlzpUlYToFL9uWHoDouANK3kDLyM7WpEPIajU6Cuq5C97KsqQWNTrFypLlYx/IiUbKg0LJVyckw0jl98iY7jIDOKkQmNIYwaQ8IvXtJ459Jo0DSvmE8IEoCxskfvlh7YZU9keu1spW/k8M22RPvrrjU34IhIokkA1KbVBaNyMRoypjH0PptRleU4+Vmdf4MGg9heft2+JqYcs7pHVDYVSs1TFPRfmlhcf2CtixuWcqIpNiQEW/S1ZdcJ7Ifsv+6hNTYQqqNz6fS70cm58mA7lPZ+LFoNaaXcCYAHwq+y3RYXlm1I1fEDrv6RLuxNvOWAxGelCvDv5M5M3zdm5DHvrmPMk8fOfRKck7eWRMD6o/FV4f/K04R3TY=
  account: mediocregopher
2020-03-26 21:14:54 -06:00

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/http-server/nginx.conf /etc/nginx/nginx.conf
# Create pre-receive
COPY cmd/http-server/pre-receive /pre-receive
# Create start.sh
COPY cmd/http-server/start.sh /start.sh
RUN chmod +x /start.sh
ENTRYPOINT ["/start.sh"]