Organize Docker deployment files

This commit is contained in:
Formsmith
2026-06-20 10:18:54 +03:00
parent 57361a3b2a
commit 5ddd514fb7
6 changed files with 13 additions and 10 deletions
+6 -5
View File
@@ -78,7 +78,7 @@ Requirements:
Build and start SketchForge: Build and start SketchForge:
```bash ```bash
docker compose up --build -d npm run docker:up
``` ```
Open it on the server: Open it on the server:
@@ -96,20 +96,20 @@ http://SERVER_IP:3000/
To use another host port: To use another host port:
```bash ```bash
SKETCHFORGE_PORT=8080 docker compose up --build -d SKETCHFORGE_PORT=8080 npm run docker:up
``` ```
On PowerShell: On PowerShell:
```powershell ```powershell
$env:SKETCHFORGE_PORT = "8080" $env:SKETCHFORGE_PORT = "8080"
docker compose up --build -d npm run docker:up
``` ```
Stop the server with: Stop the server with:
```bash ```bash
docker compose down npm run docker:down
``` ```
### Manual Static Deployment (Advanced) ### Manual Static Deployment (Advanced)
@@ -138,7 +138,7 @@ npm run build
Remove-Item Env:STATIC_EXPORT Remove-Item Env:STATIC_EXPORT
``` ```
The deployable files are generated in `apps/web/out`. Configure the web server to serve that directory and fall back to `index.html` for unknown application paths. [`deploy/nginx.conf`](deploy/nginx.conf) is the configuration used by the Docker image and can be adapted for a manual Nginx installation. The deployable files are generated in `apps/web/out`. Configure the web server to serve that directory and fall back to `index.html` for unknown application paths. [`deploy/docker/nginx.conf`](deploy/docker/nginx.conf) is the configuration used by the Docker image and can be adapted for a manual Nginx installation.
The administrator must also open the chosen LAN port in the server firewall and arrange for the web server to start automatically after a reboot. For each SketchForge update, pull the new source, install dependencies, rebuild `apps/web/out`, replace the served files, and reload the web server. The administrator must also open the chosen LAN port in the server firewall and arrange for the web server to start automatically after a reboot. For each SketchForge update, pull the new source, install dependencies, rebuild `apps/web/out`, replace the served files, and reload the web server.
@@ -173,6 +173,7 @@ apps/web/src/generated/ Generated Manifold runtime source
apps/web/src/lib/ Shared utilities apps/web/src/lib/ Shared utilities
apps/web/public/assets/ Static app images, icons, logos, shape assets apps/web/public/assets/ Static app images, icons, logos, shape assets
docs/media/ README screenshots and demo videos docs/media/ README screenshots and demo videos
deploy/docker/ Docker, Compose, and Nginx deployment files
.github/ Issue templates and community files .github/ Issue templates and community files
``` ```
+1 -1
View File
@@ -15,7 +15,7 @@ RUN npm run build
FROM nginx:stable-alpine AS runner FROM nginx:stable-alpine AS runner
COPY deploy/nginx.conf /etc/nginx/conf.d/default.conf COPY deploy/docker/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/apps/web/out /usr/share/nginx/html COPY --from=builder /app/apps/web/out /usr/share/nginx/html
EXPOSE 80 EXPOSE 80
+2 -2
View File
@@ -2,8 +2,8 @@ services:
sketchforge: sketchforge:
image: sketchforge:local image: sketchforge:local
build: build:
context: . context: ../..
dockerfile: Dockerfile dockerfile: deploy/docker/Dockerfile
ports: ports:
- "${SKETCHFORGE_PORT:-3000}:80" - "${SKETCHFORGE_PORT:-3000}:80"
restart: unless-stopped restart: unless-stopped
+4 -2
View File
@@ -12,8 +12,10 @@
"test:watch": "vitest --config tests/vitest.config.ts", "test:watch": "vitest --config tests/vitest.config.ts",
"perf": "vitest run --config tests/vitest.perf.config.ts --reporter verbose", "perf": "vitest run --config tests/vitest.perf.config.ts --reporter verbose",
"ci": "npm run typecheck && npm run test", "ci": "npm run typecheck && npm run test",
"docker:build": "docker build -t sketchforge:local .", "docker:build": "docker build -f deploy/docker/Dockerfile -t sketchforge:local .",
"docker:run": "docker run --rm -p 3000:80 sketchforge:local" "docker:run": "docker run --rm -p 3000:80 sketchforge:local",
"docker:up": "docker compose -f deploy/docker/compose.yaml up --build -d",
"docker:down": "docker compose -f deploy/docker/compose.yaml down"
}, },
"dependencies": { "dependencies": {
"@tailwindcss/postcss": "^4.1.8", "@tailwindcss/postcss": "^4.1.8",