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.
36 lines
1.3 KiB
36 lines
1.3 KiB
FROM alpine:latest |
|
|
|
RUN echo "http://dl-cdn.alpinelinux.org/alpine/v3.10/community" >> /etc/apk/repositories |
|
|
|
# install required packages |
|
#RUN apk add --no-cache gcc libc-dev libffi-dev openssl openssl-dev python3-dev |
|
RUN apk add --no-cache apache2 apache2-utils apache2-webdav mod_dav_svn subversion |
|
|
|
# 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 |
|
|
|
# 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:8080/' /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"] |