Merge ebed9b99c9 into 6a5cb00131
This commit is contained in:
commit
4e60e179a4
33
Dockerfile
33
Dockerfile
|
|
@ -1,8 +1,31 @@
|
||||||
# You may find this Dockerfile useful in development or production
|
# Build: `docker build . -t civiproxy`
|
||||||
# From the CiviProxy directory
|
# Run: `docker run -d -p 4050:4050 --name civiproxy civiproxy`
|
||||||
# * Build a docker image with `docker build . -t civiproxy`
|
# Browse: https://localhost:4050
|
||||||
# * Run a development container with `run -d -p 4050:80 -v $PWD/proxy:/var/www/html --name civiproxy civiproxy`
|
|
||||||
|
|
||||||
|
# This is a multi-stage build file. See https://docs.docker.com/develop/dev-best-practices/
|
||||||
|
|
||||||
|
# Generate SSL/TLS cert and key.
|
||||||
|
FROM debian:buster-slim AS cert_builder
|
||||||
|
RUN apt update && apt install -y openssl
|
||||||
|
RUN sed -i 's/^# subjectAltName=email:copy/subjectAltName=DNS:localhost/g' /etc/ssl/openssl.cnf
|
||||||
|
RUN /usr/bin/openssl req \
|
||||||
|
-subj '/CN=localhost/O=CiviProxyDev/C=UK' \
|
||||||
|
-nodes \
|
||||||
|
-new \
|
||||||
|
-x509 \
|
||||||
|
-newkey rsa:2048 \
|
||||||
|
-keyout /etc/ssl/certs/civiproxy.key \
|
||||||
|
-out /etc/ssl/certs/civiproxy.crt \
|
||||||
|
-days 1095
|
||||||
|
|
||||||
|
# Stand up CiviProxy
|
||||||
FROM php:7-apache
|
FROM php:7-apache
|
||||||
|
COPY --from=cert_builder /etc/ssl/certs/ /etc/ssl/certs/
|
||||||
COPY proxy/ /var/www/html
|
COPY proxy/ /var/www/html
|
||||||
|
COPY civiproxy.ssl.conf /etc/apache2/sites-available/
|
||||||
|
RUN a2enmod ssl
|
||||||
|
RUN service apache2 restart
|
||||||
|
RUN a2dissite 000-default.conf
|
||||||
|
RUN a2dissite default-ssl.conf
|
||||||
|
RUN a2ensite civiproxy.ssl.conf
|
||||||
|
EXPOSE 4050
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
Listen 4050
|
||||||
|
<VirtualHost _default_:4050>
|
||||||
|
ServerAdmin webmaster@localhost
|
||||||
|
DocumentRoot /var/www/html
|
||||||
|
|
||||||
|
ErrorLog ${APACHE_LOG_DIR}/error.log
|
||||||
|
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
||||||
|
|
||||||
|
SSLEngine on
|
||||||
|
SSLCertificateFile /etc/ssl/certs/civiproxy.crt
|
||||||
|
SSLCertificateKeyFile /etc/ssl/certs/civiproxy.key
|
||||||
|
</VirtualHost>
|
||||||
Loading…
Reference in New Issue