Dockerfile.stable 1.56 KB
Newer Older
remy's avatar
-a  
remy committed
1
2
3
4
5
6
7
FROM alpine:3.9

LABEL Author remyd1 - https://github.com/remyd1
RUN apk --update add php-apache2 php7-session php7-mysqli && rm -f /var/cache/apk/*


RUN mkdir /app && cd /app && \
remy's avatar
remy committed
8
9
10
11
12
13
  wget https://gitlab.mbb.univ-montp2.fr/jlopez/wicopa/-/archive/v0.4.1/wicopa-v0.4.1.tar.gz && \
  tar -xf wicopa-v0.4.1.tar.gz && ln -s wicopa-v0.4.1 wicopa

WORKDIR /app/wicopa

RUN cp inc/conf/Conf.php.sample inc/conf/Conf.php && \
remy's avatar
-a  
remy committed
14
  chown -R apache:apache /app && \
remy's avatar
remy committed
15
16
17
18
19
  sed -i "s#DB_NAME       = ''#DB_NAME       = 'wicopa'#"     inc/conf/Conf.php && \
  sed -i "s#DB_HOSTNAME   = ''#DB_HOSTNAME   = 'wicopadb'#"   inc/conf/Conf.php && \
  sed -i "s#DB_USERNAME   = ''#DB_USERNAME   = 'wicopauser'#" inc/conf/Conf.php && \
  sed -i "s#DB_PP         = ''#DB_PP         = 'w1c0Pa5s'#"   inc/conf/Conf.php && \
  sed -i "s#'to_replace_with_your_admin_pass'#'450cb0c92db35549cb926efc391df2ceae4b48d1'#" inc/conf/Conf.php
remy's avatar
-a  
remy committed
20
21
22
23
24
25
26
27
28
29
30
31
32
33

RUN sed -i 's/^#ServerName .*/ServerName localhost:80/g' /etc/apache2/httpd.conf && \
  sed -i 's#/var/www/localhost/htdocs#/app/wicopa#g' /etc/apache2/httpd.conf && \
  sed -i 's/^LoadModule php7_module.*/LoadModule php7_module modules\/libphp7\.so/g' /etc/apache2/httpd.conf && \
  sed -i 's/DirectoryIndex index\.html/DirectoryIndex index\.php/g' /etc/apache2/httpd.conf && \
  sed -ri 's#^DocumentRoot .*#DocumentRoot "/app/wicopa"#g' /etc/apache2/httpd.conf && \
  sed -i 's#AllowOverride None#AllowOverride All#g' /etc/apache2/httpd.conf && \
  echo "AddType application/x-httpd-php .php" >> /etc/apache2/httpd.conf

RUN echo "Success"

EXPOSE 80

ENTRYPOINT httpd -D FOREGROUND && /bin/bash