This commit is contained in:
louiscklaw
2025-02-01 02:03:24 +08:00
parent 8bf2589af5
commit a1833c6795
71 changed files with 2920 additions and 0 deletions

9
docker-share/Dockerfile Normal file
View File

@@ -0,0 +1,9 @@
# CREDIT: https://github.com/shren207/nextjs-docker-compose
# Dockerfile
FROM node:18-buster
RUN mkdir -p /app/node_modules
RUN chown 1000:1000 -R /app
WORKDIR /app
USER 1000:1000

View File

@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -ex
npm i
npm run start

2117
docker-share/app/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,17 @@
{
"name": "app",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "http-server --cors ./public"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"http-server": "^14.1.1",
"serve": "^14.2.0"
}
}

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
helloworld
</body>
</html>

View File

@@ -0,0 +1,31 @@
# CREDIT: https://github.com/shren207/nextjs-docker-compose
services:
leewinnie818_share:
container_name: leewinnie818_share
build: .
restart: always
volumes:
- $PWD/app:/app
- leewinnie818_node_modules:/app/node_modules
working_dir: /app
# command: sleep infinity
command: bash entry.sh
labels:
- "traefik.enable=true"
- "traefik.http.routers.leewinnie818-http.rule=Host(`leewinnie818.louislabs.com`)"
- "traefik.http.routers.leewinnie818-http.entrypoints=web"
- "traefik.http.routers.leewinnie818-http.middlewares=leewinnie818-https"
- "traefik.http.middlewares.leewinnie818-https.redirectscheme.scheme=https"
- "traefik.http.routers.leewinnie818.rule=Host(`leewinnie818.louislabs.com`)"
- "traefik.http.routers.leewinnie818.entrypoints=websecure"
- "traefik.http.routers.leewinnie818.tls.certresolver=myresolver"
- "traefik.http.services.leewinnie818.loadbalancer.server.port=8080"
networks:
default:
external:
name: traefik-proxy-network
volumes:
leewinnie818_node_modules:

13
docker-share/package.json Normal file
View File

@@ -0,0 +1,13 @@
{
"name": "docker-helloworld",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"into_docker": "docker compose exec -it test bash"
},
"keywords": [],
"author": "",
"license": "ISC"
}

10
docker-share/up.sh Normal file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
git pull
docker compose pull
docker compose build
docker compose kill
docker compose down
docker compose up -d
docker compose logs -f