mirror of
https://git.verdigado.com/NB-Public/simple-wkd.git
synced 2024-12-06 14:52:41 +01:00
Compare commits
No commits in common. "e141e742b96b991e1003969420fd70fa1f583d79" and "a61f03f412eaa2f4d8a1a33f42e80f4839c2aecb" have entirely different histories.
e141e742b9
...
a61f03f412
9 changed files with 4682 additions and 3838 deletions
11
.dockerignore
Normal file
11
.dockerignore
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
*config.toml
|
||||||
|
Dockerfile
|
||||||
|
README.md
|
||||||
|
.github/workflows/*
|
||||||
|
backend/data/*
|
||||||
|
backend/logs/*
|
||||||
|
backend/target/*
|
||||||
|
website/README.md
|
||||||
|
website/dist/*
|
||||||
|
website/node_modules/*
|
||||||
|
website/.vscode/*
|
42
Dockerfile
Normal file
42
Dockerfile
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
ARG base="alpine:3.18"
|
||||||
|
|
||||||
|
|
||||||
|
FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx
|
||||||
|
FROM --platform=$BUILDPLATFORM ${base} AS bin-builder
|
||||||
|
|
||||||
|
ARG TARGETPLATFORM
|
||||||
|
COPY --from=xx / /
|
||||||
|
|
||||||
|
# Enable cargo sparse index for faster update times, see: https://blog.rust-lang.org/inside-rust/2023/01/30/cargo-sparse-protocol.html
|
||||||
|
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
|
||||||
|
|
||||||
|
RUN apk add clang lld musl-dev cargo
|
||||||
|
COPY backend .
|
||||||
|
RUN xx-cargo build --release --target-dir ./build && \
|
||||||
|
xx-verify ./build/$(xx-cargo --print-target-triple)/release/simple-wkd
|
||||||
|
RUN mv ./build/$(xx-cargo --print-target-triple)/release/simple-wkd simple-wkd-executable
|
||||||
|
|
||||||
|
|
||||||
|
FROM --platform=$BUILDPLATFORM ${base} AS webpage-builder
|
||||||
|
|
||||||
|
RUN apk add npm
|
||||||
|
COPY website .
|
||||||
|
RUN npm install -g pnpm && \
|
||||||
|
pnpm install && \
|
||||||
|
pnpm run build
|
||||||
|
COPY assets assets
|
||||||
|
# Move website in templates folder
|
||||||
|
RUN mv dist assets/webpage
|
||||||
|
|
||||||
|
|
||||||
|
FROM ${base}
|
||||||
|
|
||||||
|
WORKDIR /wkd
|
||||||
|
COPY entrypoint.sh entrypoint.sh
|
||||||
|
COPY --from=webpage-builder assets assets
|
||||||
|
COPY --from=bin-builder simple-wkd-executable wkd
|
||||||
|
RUN apk add --no-cache libgcc && \
|
||||||
|
adduser --no-create-home --disabled-password wkd && \
|
||||||
|
chown -R wkd:wkd /wkd
|
||||||
|
|
||||||
|
ENTRYPOINT [ "sh", "/wkd/entrypoint.sh" ]
|
|
@ -1,15 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
apt install -y clang lld cargo
|
|
||||||
cp -R backend/* .
|
|
||||||
cargo build --release --target-dir ./build
|
|
||||||
mv ./build/release/simple-wkd simple-wkd-executable
|
|
||||||
|
|
||||||
|
|
||||||
apt install -y npm
|
|
||||||
cp -R website/* .
|
|
||||||
npm install -g pnpm && \
|
|
||||||
pnpm install && \
|
|
||||||
pnpm astro telemetry disable && \
|
|
||||||
pnpm run build
|
|
||||||
mv dist assets/webpage
|
|
17
docker-compose.yml
Normal file
17
docker-compose.yml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
keyserver:
|
||||||
|
image: "delta1925/simple-wkd"
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- 8080:8080
|
||||||
|
environment:
|
||||||
|
- RUST_LOG=debug
|
||||||
|
volumes:
|
||||||
|
- ./config.toml:/wkd/config.toml
|
||||||
|
- wkd-data:/wkd/data
|
||||||
|
- wkd-logs:/wkd/logs
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
wkd-data:
|
||||||
|
wkd-logs:
|
3
entrypoint.sh
Normal file
3
entrypoint.sh
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
chown -R wkd:wkd /wkd
|
||||||
|
su wkd -c /wkd/wkd
|
|
@ -1,6 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
cp -R assets /srv/wkd/assets
|
|
||||||
cp simple-wkd-executable /srv/wkd/wkd
|
|
||||||
cp wkd.service /etc/systemd/system/wkd.service
|
|
||||||
useradd --no-create-home wkd
|
|
||||||
chown -R wkd:wkd /srv/wkd
|
|
|
@ -10,15 +10,15 @@
|
||||||
"astro": "astro"
|
"astro": "astro"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/tailwind": "^5.1.2",
|
"@astrojs/tailwind": "^3.1.1",
|
||||||
"@tailwindcss/forms": "^0.5.9",
|
"@tailwindcss/forms": "^0.5.3",
|
||||||
"astro": "^4.16.7",
|
"astro": "^2.3.0",
|
||||||
"astro-critters": "^2.2.0",
|
"astro-critters": "^1.1.31",
|
||||||
"tailwindcss": "^3.4.14"
|
"tailwindcss": "^3.0.24"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"prettier": "^3.3.3",
|
"prettier": "^2.8.7",
|
||||||
"prettier-plugin-astro": "^0.14.1",
|
"prettier-plugin-astro": "^0.8.0",
|
||||||
"prettier-plugin-tailwindcss": "^0.6.8"
|
"prettier-plugin-tailwindcss": "^0.2.7"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
8398
website/pnpm-lock.yaml
generated
8398
website/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
12
wkd.service
12
wkd.service
|
@ -1,12 +0,0 @@
|
||||||
[Unit]
|
|
||||||
Description=WKD Service
|
|
||||||
After=network.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
User=wkd
|
|
||||||
ExecStart=/srv/wkd/wkd
|
|
||||||
Restart=always
|
|
||||||
WorkingDirectory=/srv/wkd
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
Loading…
Add table
Reference in a new issue