Initial server-stack setup

This commit is contained in:
JamBox
2026-02-15 20:04:18 -08:00
commit 7f14c826f2
10 changed files with 122 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
caddy_data/
gitea_data/
apps/*/data/

View File

@@ -0,0 +1,6 @@
FROM node:20-alpine
WORKDIR /app
COPY package.json server.js ./
RUN npm install
EXPOSE 8080
CMD ["node", "server.js"]

View File

@@ -0,0 +1,8 @@
{
"name": "jamesvanboxtel",
"version": "1.0.0",
"private": true,
"dependencies": {
"express": "^4.21.0"
}
}

View File

@@ -0,0 +1,22 @@
const express = require("express");
const app = express();
app.get("/", (req, res) => {
res.send(`<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>jamesvanboxtel.com</title>
<style>
body { margin: 0; display: flex; justify-content: center; align-items: center; min-height: 100vh; font-family: system-ui, sans-serif; background: #fafafa; color: #333; }
h1 { font-size: 3rem; font-weight: 300; }
</style>
</head>
<body>
<h1>jamesvanboxtel.com</h1>
</body>
</html>`);
});
app.listen(8080, () => console.log("jamesvanboxtel running on :8080"));

6
apps/tessavb/Dockerfile Normal file
View File

@@ -0,0 +1,6 @@
FROM node:20-alpine
WORKDIR /app
COPY package.json server.js ./
RUN npm install
EXPOSE 8080
CMD ["node", "server.js"]

View File

@@ -0,0 +1,8 @@
{
"name": "tessavb",
"version": "1.0.0",
"private": true,
"dependencies": {
"express": "^4.21.0"
}
}

22
apps/tessavb/server.js Normal file
View File

@@ -0,0 +1,22 @@
const express = require("express");
const app = express();
app.get("/", (req, res) => {
res.send(`<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>tessavb.com</title>
<style>
body { margin: 0; display: flex; justify-content: center; align-items: center; min-height: 100vh; font-family: system-ui, sans-serif; background: #fafafa; color: #333; }
h1 { font-size: 3rem; font-weight: 300; }
</style>
</head>
<body>
<h1>tessavb.com</h1>
</body>
</html>`);
});
app.listen(8080, () => console.log("tessavb running on :8080"));

4
deploy.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
cd /home/$USER/server-stack
git pull origin main
docker compose up -d --build

36
docker-compose.yml Normal file
View File

@@ -0,0 +1,36 @@
services:
caddy:
image: lucaslorentz/caddy-docker-proxy:ci-alpine
container_name: caddy
ports:
- "80:80"
- "443:443"
environment:
- CADDY_INGRESS_NETWORKS=server-stack_server-network
networks:
- server-network
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./caddy_data:/data
restart: unless-stopped
gitea:
image: gitea/gitea:latest
container_name: gitea
environment:
- USER_UID=1000
- USER_GID=1000
networks:
- server-network
volumes:
- ./gitea_data:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
labels:
caddy: git.jamesvanboxtel.com
caddy.reverse_proxy: "{{upstreams 3000}}"
restart: always
networks:
server-network:
external: false

7
hooks.json Normal file
View File

@@ -0,0 +1,7 @@
[
{
"id": "redeploy-apps",
"execute-command": "/home/james/server-stack/deploy.sh",
"command-working-directory": "/home/james/server-stack"
}
]