-
Notifications
You must be signed in to change notification settings - Fork 23
/
Dockerfile
44 lines (35 loc) · 1.4 KB
/
Dockerfile
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
FROM nginx:1.11.9
# Desired version of grav
ARG GRAV_VERSION=1.1.16
# Install dependencies
RUN apt-get update && \
apt-get install -y sudo wget vim unzip php5 php5-curl php5-gd php-pclzip php5-fpm
ADD https://github.com/krallin/tini/releases/download/v0.13.2/tini /usr/local/bin/tini
RUN chmod +x /usr/local/bin/tini
# Set user to www-data
RUN mkdir -p /var/www && chown www-data:www-data /var/www
USER www-data
# Install grav
WORKDIR /var/www
RUN wget https://github.com/getgrav/grav/releases/download/$GRAV_VERSION/grav-admin-v$GRAV_VERSION.zip && \
unzip grav-admin-v$GRAV_VERSION.zip && \
rm grav-admin-v$GRAV_VERSION.zip && \
cd grav-admin && \
bin/gpm install -f -y admin
# Return to root user
USER root
# Install Acmetool Let's Encrypt client
RUN echo 'deb http://ppa.launchpad.net/hlandau/rhea/ubuntu xenial main' > /etc/apt/sources.list.d/rhea.list \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9862409EF124EC763B84972FF5AC9651EDB58DFA \
&& apt-get update \
&& apt-get install acmetool
# Configure nginx with grav
WORKDIR grav-admin
RUN cd webserver-configs && \
sed -i 's/root \/home\/USER\/www\/html/root \/var\/www\/grav-admin/g' nginx.conf && \
cp nginx.conf /etc/nginx/conf.d/default.conf
# Set the file permissions
RUN usermod -aG www-data nginx
# Run startup script
ADD resources /
ENTRYPOINT [ "/usr/local/bin/tini", "--", "/usr/local/bin/startup.sh" ]