dockerize, deployable, update package for git.gay
This commit is contained in:
parent
7e7fe6d9e7
commit
72755d1b17
4 changed files with 60 additions and 11 deletions
16
Dockerfile
Normal file
16
Dockerfile
Normal file
|
@ -0,0 +1,16 @@
|
|||
# build with nodejs
|
||||
FROM node:16.17.0-bullseye-slim AS build
|
||||
ENV NODE_ENV production
|
||||
WORKDIR /app
|
||||
COPY . /app
|
||||
RUN mkdir -p dist node_modules
|
||||
RUN chown -R node:node .
|
||||
USER node
|
||||
RUN NODE_ENV=development npm ci
|
||||
RUN npm run build
|
||||
|
||||
# serve compiled files with local nginx config
|
||||
FROM nginx:alpine
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/dist .
|
||||
COPY ./nginx.conf /etc/nginx/nginx.conf
|
12
docker-compose.yml
Normal file
12
docker-compose.yml
Normal file
|
@ -0,0 +1,12 @@
|
|||
version: "3.9"
|
||||
|
||||
services:
|
||||
app:
|
||||
container_name: nginx-gaiety-life
|
||||
image: nginx-gaiety-life
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
restart: always
|
||||
ports:
|
||||
- "9998:8080"
|
22
nginx.conf
Normal file
22
nginx.conf
Normal file
|
@ -0,0 +1,22 @@
|
|||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
sendfile on;
|
||||
|
||||
server {
|
||||
listen 8080;
|
||||
listen [::]:8080;
|
||||
|
||||
resolver 127.0.0.11;
|
||||
autoindex on;
|
||||
|
||||
server_name _;
|
||||
server_tokens off;
|
||||
|
||||
root /app;
|
||||
gzip_static on;
|
||||
}
|
||||
}
|
21
package.json
21
package.json
|
@ -2,29 +2,28 @@
|
|||
"name": "gaiety-life",
|
||||
"version": "2.0.0",
|
||||
"description": "Gaiety's Blog",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build:styles": "tailwindcss -i ./styles/main.css -o ./_site/main.css",
|
||||
"build:site": "eleventy",
|
||||
"build": "npm run build:site & npm run build:styles",
|
||||
"serve:styles": "npm run build:styles -- --watch",
|
||||
"serve:site": "npm run build:site -- --serve",
|
||||
"build": "eleventy",
|
||||
"postbuild": "tailwindcss -i ./styles/main.css -o ./_site/main.css",
|
||||
"serve:styles": "tailwindcss -i ./styles/main.css -o ./_site/main.css --watch",
|
||||
"serve:site": "eleventy --serve",
|
||||
"serve": "concurrently \"npm run serve:site\" \"npm run serve:styles\"",
|
||||
"start": "npm run serve"
|
||||
"start": "npm run serve",
|
||||
"deploy": "docker compose up --build -d"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@gitlab.com/gaiety/gaiety-life.git"
|
||||
"url": "git+git@git.gay:gaiety/gaiety-life.git"
|
||||
},
|
||||
"keywords": [
|
||||
"blog"
|
||||
],
|
||||
"author": "Ava Gaiety W.",
|
||||
"author": "Ava Gaiety W. <ava@wroten.me> (https://www.gaiety.me/)",
|
||||
"license": "The Unlicense",
|
||||
"bugs": {
|
||||
"url": "https://gitlab.com/gaiety/gaiety-life/issues"
|
||||
"url": "https://git.gay/gaiety/gaiety-life/issues"
|
||||
},
|
||||
"homepage": "https://gitlab.com/gaiety/gaiety-life#readme",
|
||||
"homepage": "https://git.gay/gaiety/gaiety-life/src/branch/main/README.md",
|
||||
"devDependencies": {
|
||||
"@11ty/eleventy": "^2.0.1",
|
||||
"@11ty/eleventy-plugin-rss": "^1.1.2",
|
||||
|
|
Loading…
Add table
Reference in a new issue