Add a dockerfile
This commit is contained in:
parent
97587a6a35
commit
6ad69be41f
5 changed files with 390 additions and 1107 deletions
22
.github/workflows/deploy.yml
vendored
Normal file
22
.github/workflows/deploy.yml
vendored
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
name: Deploy
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
|
- name: Build production container
|
||||||
|
run: docker build --tag docker.pkg.github.com/${GITHUB_REPOSITORY,,}/prod:latest .
|
||||||
|
|
||||||
|
- name: Log into GitHub Docker Registry
|
||||||
|
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login docker.pkg.github.com -u ${GITHUB_REPOSITORY%/*} --password-stdin
|
||||||
|
|
||||||
|
- name: Push the Docker container
|
||||||
|
run: docker push docker.pkg.github.com/${GITHUB_REPOSITORY,,}/prod:latest
|
28
Dockerfile
Normal file
28
Dockerfile
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
# Get Hugo
|
||||||
|
FROM jojomi/hugo:0.68.3 as hugo
|
||||||
|
|
||||||
|
RUN chmod 0777 /usr/local/sbin/hugo
|
||||||
|
|
||||||
|
# Site Build
|
||||||
|
FROM node:lts-buster-slim as build
|
||||||
|
|
||||||
|
ENV NODE_ENV production
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY --from=hugo /usr/local/sbin/hugo /usr/local/bin/hugo
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y ca-certificates
|
||||||
|
|
||||||
|
COPY . /app
|
||||||
|
|
||||||
|
RUN npm ci --production
|
||||||
|
|
||||||
|
RUN ./scripts/release.sh
|
||||||
|
|
||||||
|
# Production run
|
||||||
|
FROM nginx:stable-alpine
|
||||||
|
|
||||||
|
COPY nginx.conf /etc/nginx/nginx.conf
|
||||||
|
|
||||||
|
COPY --from=build /app/public/ /usr/share/nginx/html
|
42
nginx.conf
Normal file
42
nginx.conf
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
user nginx;
|
||||||
|
worker_processes auto;
|
||||||
|
|
||||||
|
error_log stderr;
|
||||||
|
pid /var/run/nginx.pid;
|
||||||
|
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 1024;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
http {
|
||||||
|
include /etc/nginx/mime.types;
|
||||||
|
default_type application/octet-stream;
|
||||||
|
|
||||||
|
access_log /dev/stdout;
|
||||||
|
|
||||||
|
sendfile on;
|
||||||
|
|
||||||
|
keepalive_timeout 65;
|
||||||
|
|
||||||
|
gzip on;
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name localhost;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html index.htm;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_page 404 /404.html;
|
||||||
|
|
||||||
|
error_page 500 502 503 504 /50x.html;
|
||||||
|
location = /50x.html {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
1401
package-lock.json
generated
1401
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -9,7 +9,6 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"broken-link-checker-local": "0.2.1",
|
"broken-link-checker-local": "0.2.1",
|
||||||
"eslint-config-dabapps": "6.0.2",
|
"eslint-config-dabapps": "6.0.2",
|
||||||
"parcel-bundler": "1.12.4",
|
|
||||||
"sass-lint": "1.13.1",
|
"sass-lint": "1.13.1",
|
||||||
"yaml-lint": "1.2.4"
|
"yaml-lint": "1.2.4"
|
||||||
},
|
},
|
||||||
|
@ -20,6 +19,7 @@
|
||||||
"jquery": "3.4.1",
|
"jquery": "3.4.1",
|
||||||
"lg-thumbnail": "1.1.0",
|
"lg-thumbnail": "1.1.0",
|
||||||
"lightgallery": "1.6.12",
|
"lightgallery": "1.6.12",
|
||||||
"mermaid": "8.4.8"
|
"mermaid": "8.4.8",
|
||||||
|
"parcel-bundler": "1.12.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue