Deploy
This commit is contained in:
8
.env_dist
Normal file
8
.env_dist
Normal file
@@ -0,0 +1,8 @@
|
||||
# Script saving configuration
|
||||
ENABLE_SAVE=true
|
||||
SAVE_SECRET=save
|
||||
SAVE_DIRECTORY=./data/scripts
|
||||
MAX_FILENAME_LENGTH=32
|
||||
|
||||
# Next.js environment
|
||||
NODE_ENV=production
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,3 +5,4 @@ target
|
||||
.DS_Store
|
||||
webui/src/wasm
|
||||
webui/data
|
||||
.env
|
||||
|
||||
31
Dockerfile
Normal file
31
Dockerfile
Normal file
@@ -0,0 +1,31 @@
|
||||
FROM rust:1.91 AS rust-builder
|
||||
|
||||
WORKDIR /app
|
||||
RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
||||
|
||||
COPY rust/ ./rust/
|
||||
WORKDIR /app/rust/rhai-codemirror
|
||||
RUN wasm-pack build --target web --out-dir "../../webui/src/wasm/rhai-codemirror"
|
||||
|
||||
WORKDIR /app/rust/runner
|
||||
RUN wasm-pack build --target web --out-dir "../../webui/src/wasm/runner"
|
||||
|
||||
|
||||
FROM node:24-alpine AS app
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN npm install -g bun
|
||||
COPY webui/package.json webui/bun.lock* ./webui/
|
||||
|
||||
WORKDIR /app/webui
|
||||
RUN bun install --frozen-lockfile
|
||||
COPY webui/ ./
|
||||
COPY --from=rust-builder /app/webui/src/wasm/ ./src/wasm/
|
||||
|
||||
RUN bun run build
|
||||
|
||||
RUN mkdir -p ../data/scripts
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["bun", "start"]
|
||||
12
docker-compose.yml
Normal file
12
docker-compose.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
webui:
|
||||
build: .
|
||||
ports:
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
- ./data:/app/data
|
||||
env_file:
|
||||
- .env
|
||||
restart: unless-stopped
|
||||
@@ -1,8 +1,8 @@
|
||||
export const SAVE_CONFIG = {
|
||||
ENABLE_SAVE: true,
|
||||
SAVE_SECRET: "save",
|
||||
ENABLE_SAVE: process.env.ENABLE_SAVE === 'true' || true,
|
||||
SAVE_SECRET: process.env.SAVE_SECRET || "save",
|
||||
|
||||
SAVE_DIRECTORY: "./data/scripts",
|
||||
MAX_FILENAME_LENGTH: 32,
|
||||
SAVE_DIRECTORY: process.env.SAVE_DIRECTORY || "./data/scripts",
|
||||
MAX_FILENAME_LENGTH: parseInt(process.env.MAX_FILENAME_LENGTH || "32"),
|
||||
FILENAME_REGEX: /^[a-zA-Z0-9_\s-]+$/,
|
||||
} as const;
|
||||
|
||||
Reference in New Issue
Block a user