Browse Source

svn working with ubuntu base

main
Holger Frey 3 years ago
parent
commit
ecefb97790
  1. 9
      Dockerfile
  2. 44
      Dockerfile-alpine
  3. 1
      httpd-foreground
  4. 7
      httpd-foreground alpine

9
Dockerfile

@ -8,16 +8,18 @@ RUN apt-get update && apt-get upgrade -y
RUN groupadd -g 1000 deploy RUN groupadd -g 1000 deploy
RUN useradd -u 1000 -g deploy deploy RUN useradd -u 1000 -g deploy deploy
# install required packages for debugging
# RUN apt-get install -y vim curl lsof
# #
# CUSTOM PART IS BELOW HERE # CUSTOM PART IS BELOW HERE
# #
# install required packages # install required packages
RUN apt-get install -y apache2 apache2-utils libapache2-mod-svn subversion RUN apt-get install -y apache2 apache2-utils libapache2-mod-svn subversion
# install required packages for debugging
# RUN apt-get install -y vim curl lsof
# copy the script to run httpd in foreground # copy the script to run httpd in foreground
COPY httpd-foreground /usr/local/bin/ COPY httpd-foreground /usr/local/bin/
RUN chmod u+x /usr/local/bin/httpd-foreground RUN chmod u+x /usr/local/bin/httpd-foreground
@ -30,7 +32,6 @@ ADD dav_svn.conf /etc/apache2/sites-enabled/dav_svn.conf
# adjust apache configuration files # adjust apache configuration files
#RUN sed -i.bak 's/LogLevel warn/LogLevel debug/' /etc/apache2/apache2.conf #RUN sed -i.bak 's/LogLevel warn/LogLevel debug/' /etc/apache2/apache2.conf
#RUN sed -i.bak 's/#ServerName www.example.com:80/ServerName svn.cpi.imtek.uni-freiburg.de:80/' /etc/apache2/apache2.conf
RUN sed -i.bak 's/Listen 80/Listen 80\nListen 8000/' /etc/apache2/ports.conf RUN sed -i.bak 's/Listen 80/Listen 80\nListen 8000/' /etc/apache2/ports.conf
# setup runtime variables for apache # setup runtime variables for apache

44
Dockerfile-alpine

@ -1,44 +0,0 @@
FROM alpine:3.14
RUN apk upgrade --no-cache
# add user that will be used to install and run the application
RUN addgroup -g 1000 deploy
RUN adduser -D -u 1000 -G deploy deploy
#
# CUSTOM PART IS BELOW HERE
#
# install required packages
RUN echo "http://dl-cdn.alpinelinux.org/alpine/v3.14/community" >> /etc/apk/repositories
RUN apk add --no-cache apache2 apache2-utils apache2-webdav mod_dav_svn subversion
# add svn configuration
ADD dav_svn.conf /etc/apache2/conf.d/dav_svn.conf
# create writable directory for dav lock file
RUN mkdir /var/lib/dav/
#RUN chown deploy:deploy /var/lib/dav/
# apache should run as user deploy
#RUN sed -i.bak -r 's/(User|Group) apache/\1 deploy/' /etc/apache2/httpd.conf
RUN sed -i.bak 's/#ServerName www.example.com:80/ServerName svn.cpi.imtek.uni-freiburg.de:80/' /etc/apache2/httpd.conf
RUN sed -i.bak 's/LogLevel warn/LogLevel debug/' /etc/apache2/httpd.conf
RUN sed -i.bak 's/Listen 80/Listen 80\nListen 8000/' /etc/apache2/httpd.conf
#RUN sed -i.bak 's/#LoadModule deflate_module/LoadModule deflate_module/' /etc/apache2/httpd.conf
#RUN sed -i.bak 's/#LoadModule logio_module/LoadModule logio_module/' /etc/apache2/httpd.conf
# copy the script to run httpd in foreground
COPY httpd-foreground /usr/local/bin/
#RUN chown deploy:deploy /usr/local/bin/httpd-foreground
RUN chmod u+x /usr/local/bin/httpd-foreground
# setup the right permissions for deploy user
#RUN chown -R deploy:deploy /var/www/
#RUN chown -R deploy:deploy /usr/lib/apache2/
#RUN chown -R deploy:deploy /run/apache2/
#RUN chown -R deploy:deploy /var/log/apache2/
#USER deploy
CMD ["httpd-foreground"]

1
httpd-foreground

@ -4,5 +4,4 @@ set -e
# Apache gets grumpy about PID files pre-existing # Apache gets grumpy about PID files pre-existing
rm -f /run/apache2/httpd.pid rm -f /run/apache2/httpd.pid
#source /etc/apache2/envvars
exec apache2 -DFOREGROUND "$@" exec apache2 -DFOREGROUND "$@"

7
httpd-foreground alpine

@ -1,7 +0,0 @@
#!/bin/sh
set -e
# Apache gets grumpy about PID files pre-existing
rm -f /run/apache2/httpd.pid
exec httpd -DFOREGROUND "$@"
Loading…
Cancel
Save