Formatting and trying to not use www-data
This commit is contained in:
29
Dockerfile
29
Dockerfile
@@ -18,29 +18,24 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
ADD https://github.com/krallin/tini/releases/download/v0.13.2/tini /usr/local/bin/tini
|
ADD https://github.com/krallin/tini/releases/download/v0.13.2/tini /usr/local/bin/tini
|
||||||
RUN chmod +x /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
|
# Install grav
|
||||||
WORKDIR /var/www
|
WORKDIR /var/www
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates unzip wget && \
|
RUN mkdir -p /var/www \
|
||||||
wget https://github.com/getgrav/grav/releases/download/$GRAV_VERSION/grav-admin-v$GRAV_VERSION.zip && \
|
&& apt-get update && apt-get install -y --no-install-recommends ca-certificates unzip wget \
|
||||||
unzip grav-admin-v$GRAV_VERSION.zip && \
|
&& wget https://github.com/getgrav/grav/releases/download/$GRAV_VERSION/grav-admin-v$GRAV_VERSION.zip \
|
||||||
rm grav-admin-v$GRAV_VERSION.zip && \
|
&& unzip grav-admin-v$GRAV_VERSION.zip \
|
||||||
cd grav-admin && \
|
&& rm grav-admin-v$GRAV_VERSION.zip \
|
||||||
bin/gpm install -f -y admin \
|
&& cd grav-admin \
|
||||||
|
&& bin/gpm install -f -y admin \
|
||||||
&& apt-get remove -y ca-certificates unzip wget \
|
&& apt-get remove -y ca-certificates unzip wget \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& chown www-data:www-data /var/www
|
||||||
# Return to root user
|
|
||||||
USER root
|
|
||||||
|
|
||||||
# Configure nginx with grav
|
# Configure nginx with grav
|
||||||
WORKDIR /var/www/grav-admin
|
WORKDIR /var/www/grav-admin
|
||||||
RUN cd webserver-configs && \
|
RUN cd webserver-configs \
|
||||||
sed -i 's/root \/home\/USER\/www\/html/root \/var\/www\/grav-admin/g' nginx.conf && \
|
&& 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
|
&& cp nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
# Set the file permissions
|
# Set the file permissions
|
||||||
RUN usermod -aG www-data nginx
|
RUN usermod -aG www-data nginx
|
||||||
|
|||||||
Reference in New Issue
Block a user