forked from cohabit/server_config
feat: add portfolio_server
config, service and scripts
This commit is contained in:
parent
fab58379c1
commit
35612f8982
12
portfolio_server/README.md
Normal file
12
portfolio_server/README.md
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Configuration de `portfolio_server`
|
||||
|
||||
Server de portfolio (site static) de coh@bit avec sous domaine personnalisé.
|
||||
|
||||
## Port
|
||||
|
||||
`localhost:6363`
|
||||
|
||||
## Emplacements
|
||||
|
||||
- `https://git.cohabit.fr/cohabit/portfolio_server/*` -> `/srv/portfolio/*`
|
||||
- `./systemd/*` -> `/etc/systemd/system/*`
|
11
portfolio_server/_deploy.sh
Normal file
11
portfolio_server/_deploy.sh
Normal file
|
@ -0,0 +1,11 @@
|
|||
# Pull portfolio server sources
|
||||
cd /srv/portfolio
|
||||
git pull origin main
|
||||
|
||||
# Setup portfolio server service
|
||||
cp /srv/portfolio/portfolio.service /etc/systemd/system
|
||||
|
||||
# Start portfolio server
|
||||
systemctl daemon-reload
|
||||
systemctl enable portfolio
|
||||
systemctl start portfolio
|
23
portfolio_server/_install.sh
Normal file
23
portfolio_server/_install.sh
Normal file
|
@ -0,0 +1,23 @@
|
|||
# Check if already installed
|
||||
if [[ $(which deno) == "/usr/local/bin/deno" ]]; then
|
||||
# Upgrade deno
|
||||
deno upgrade
|
||||
else
|
||||
# Install deno
|
||||
curl -fsSL https://deno.land/install.sh | DENO_INSTALL=/usr/local sh
|
||||
|
||||
# Create group and user
|
||||
groupadd --system deno
|
||||
|
||||
useradd --system \
|
||||
--gid deno \
|
||||
--create-home \
|
||||
--home-dir /var/lib/deno \
|
||||
--shell /usr/sbin/nologin \
|
||||
--comment "Deno js engine" \
|
||||
deno
|
||||
fi
|
||||
|
||||
# Clone website repo
|
||||
mkdir -p /srv/portfolio
|
||||
git clone -b main --depth 1 https://git.cohabit.fr/cohabit/portfolio_server.git /srv/portfolio
|
15
portfolio_server/systemd/portfolio.service
Normal file
15
portfolio_server/systemd/portfolio.service
Normal file
|
@ -0,0 +1,15 @@
|
|||
[Unit]
|
||||
Description=Portofolio Server 1.1.1 service
|
||||
Documentation=http://git.cohabit.fr/cohabit/portfolio_server
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=deno
|
||||
WorkingDirectory=/srv/portfolio
|
||||
ExecStart=PORT=6363 /usr/local/bin/deno task serve
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Reference in a new issue