-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.apache
52 lines (41 loc) · 1.58 KB
/
Dockerfile.apache
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Dockerfile for the Edirom Summer School website
# Use the nginx Dockerfile for the static site (when the registration is closed)
# and the apache Dockerfile (with php enabled) for the php registration form
FROM jekyll/builder as builder
ENV WORK_DIR=/var/jekyllbuilder
# since WORKDIR will not honour the USER directive
# we need to create the directory and set permissions in advance
RUN mkdir -p ${WORK_DIR} && \
chown -R jekyll:jekyll ${WORK_DIR}
# set default jekyll user for building
USER jekyll:jekyll
WORKDIR ${WORK_DIR}
COPY --chown=jekyll . .
# build local
RUN npm i && \
bundle config set --local path 'vendor/bundle' && \
bundle install && \
bundle exec jekyll build
#################
# apache
#################
FROM php:apache
LABEL maintainer="Peter Stadler for the ViFE"
LABEL org.opencontainers.image.source=https://github.com/Edirom/ess-website
ENV GMAIL_User_FILE=/run/secrets/GMAIL_User
ENV GMAIL_Password_FILE=/run/secrets/GMAIL_Password
ENV CAPTCHA_PUBLIC_KEY_FILE=/run/secrets/CAPTCHA_PUBLIC_KEY
ENV CAPTCHA_PRIVATE_KEY_FILE=/run/secrets/CAPTCHA_PRIVATE_KEY
# Use the default production configuration
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
WORKDIR /var/www/html
COPY --from=builder /var/jekyllbuilder/_site/ .
RUN apt-get update && \
apt-get install -y --no-install-recommends msmtp msmtp-mta && \
apt-get clean && \
rm -r /var/lib/apt/lists/* && \
mv entrypoint.sh /usr/local/bin/ && \
touch /var/log/msmtp.log && \
chown -h www-data:www-data /var/log/msmtp.log
ENTRYPOINT ["entrypoint.sh"]
CMD ["apache2-foreground"]