-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathDockerfile
More file actions
61 lines (39 loc) · 1.78 KB
/
Dockerfile
File metadata and controls
61 lines (39 loc) · 1.78 KB
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
53
54
55
56
57
58
59
60
61
# SPDX-FileCopyrightText: Free Software Foundation Europe e.V.
#
# SPDX-License-Identifier: GPL-3.0-or-later
# =============================================================================
# Configure webserver
# =============================================================================
FROM httpd:alpine AS webserver-prep
# Copy our vhost config & tell Apache to use it
COPY vhost.conf /usr/local/apache2/conf/
RUN echo "Include conf/vhost.conf" >> /usr/local/apache2/conf/httpd.conf
# Enable expires & rewrite modules
RUN sed -i \
-e 's/#LoadModule expires_module/LoadModule expires_module/' \
-e 's/#LoadModule rewrite_module/LoadModule rewrite_module/' \
/usr/local/apache2/conf/httpd.conf
# =============================================================================
# Development Preparation: run po4a and hugo
# =============================================================================
FROM alpine AS dev-prep
# Dependencies
RUN apk --no-cache add bash perl-yaml-tiny po4a hugo python3 diffutils
COPY . /app
WORKDIR /app/
# Run po4a for reuse-website po strings
RUN po4a po4a.conf
# Create .status file for important i18n translation strings
RUN python3 check_translations.py site/i18n
# Build hugo
RUN hugo -s site
# =============================================================================
# Development (use the site built in dev-prep)
# =============================================================================
FROM webserver-prep AS development
COPY --from=dev-prep /app/site/public/ /app/
# =============================================================================
# Production (use the site built in hugo step in .drone.yml)
# =============================================================================
FROM webserver-prep AS production
COPY site/public/ /app/