~jeffa/jeffa.io

d3cbb43980d225e2c9d0984e7aff2680b92b1be9 — Jeff a month ago fb096bf
Change deployment to allow certbot usage
2 files changed, 31 insertions(+), 18 deletions(-)

M Dockerfile
M nginx.conf
M Dockerfile => Dockerfile +29 -17
@@ 1,33 1,45 @@
# Build client
FROM node:buster AS build-client
#_______________________________________#
# Build | https://hub.docker.com/_/node #
#_______________________________________#

RUN apt-get update && \
    apt-get upgrade --assume-yes

RUN npm install --global purgecss uglifycss

RUN curl -L -o /home/pandoc.deb https://github.com/jgm/pandoc/releases/download/2.11.4/pandoc-2.11.4-1-amd64.deb && \
    dpkg -i /home/pandoc.deb
# Start

FROM node:buster AS build
WORKDIR /jeffa.io/

# Setup

RUN npm install --global purgecss uglifycss
RUN curl -L -o /home/pandoc.deb \
    https://github.com/jgm/pandoc/releases/download/2.11.4/pandoc-2.11.4-1-amd64.deb && \
    dpkg -i /home/pandoc.deb
COPY . .

# Run

RUN sh client/build.sh

# Run
FROM nginx:latest
#________________________________________#
# Serve | https://hub.docker.com/_/nginx #
#________________________________________#

RUN useradd jeffa.io-nginx
# Serve: Start

FROM nginx:latest
WORKDIR /jeffa.io/

COPY nginx.conf /etc/nginx/nginx.conf

COPY --from=build-client /jeffa.io/client/build/ /jeffa.io/client/build/
# Serve: Setup

RUN apt-get update && \
    apt-get upgrade --assume-yes && \
    apt-get install --assume-yes certbot python-certbot-nginx
RUN useradd jeffa.io-nginx
COPY nginx.conf /etc/nginx/nginx.conf
COPY --from=build /jeffa.io/client/build/ /jeffa.io/client/build/
RUN mkdir ./logs/

EXPOSE 80:80
# Serve: Run

CMD ["nginx", "-g", "daemon off;"]
EXPOSE 80:80
EXPOSE 443:443
CMD [ "nginx", "-g", "daemon off;" ]

M nginx.conf => nginx.conf +2 -1
@@ 16,7 16,8 @@ http {

    server {
        listen 80;
        server_name jeffa.io;

        server_name jeffa.io www.jeffa.io;

        access_log /jeffa.io/logs/jeffa.io.access.log  main;