feat: deploy on Caprover directly

This commit is contained in:
Pierre Martin 2023-05-08 12:15:59 +02:00
parent 751954d0ac
commit 5df925dffe
4 changed files with 28 additions and 2 deletions

2
.dockerignore Normal file
View File

@ -0,0 +1,2 @@
node_modules
public

21
Dockerfile Normal file
View File

@ -0,0 +1,21 @@
FROM node:20 as builder
WORKDIR /app
RUN npm install -g pnpm@8
COPY . .
RUN pnpm install && pnpm build
# See https://lipanski.com/posts/smallest-docker-image-static-website
FROM busybox:1.36
RUN adduser -D static
USER static
WORKDIR /home/static
COPY --from=builder /app/public .
# Run BusyBox httpd
EXPOSE 3000
CMD ["busybox", "httpd", "-f", "-v", "-p", "3000"]

4
captain-definition Normal file
View File

@ -0,0 +1,4 @@
{
"schemaVersion": 2,
"dockerfilePath": "./Dockerfile"
}

View File

@ -6,8 +6,7 @@
"clean": "rimraf public src/css/styles.css",
"dev": "npm run clean && postcss src/css/tailwind.css > src/css/styles.css && eleventy --serve",
"build": "npm run clean && NODE_ENV=production postcss src/css/tailwind.css > src/css/styles.css && eleventy",
"predeploy": "npm run build",
"deploy": "npx @getmeli/cli upload --url https://pages.sans.pub --site b9be0e93-f2e8-43f3-8d83-35cb9076fe17 --branch main --token $MELI_TOKEN ./public"
"deploy": "npx caprover deploy -a sans-pub-site -b main"
},
"repository": {
"type": "git",