Initial commit
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=Iceshrimp PostgreSQL container
|
||||
[Container]
|
||||
Image=docker.io/postgres:15-alpine
|
||||
ContainerName=iceshrimp_db
|
||||
HostName=db
|
||||
Network=iceshrimp.network
|
||||
EnvironmentFile=%h/services/iceshrimp/.config/docker.env
|
||||
Volume=%h/services/iceshrimp/db:/var/lib/postgresql/data:Z
|
||||
[Service]
|
||||
Restart=on-failure
|
||||
TimeoutStartSec=900
|
||||
[Install]
|
||||
WantedBy=iceshrimp-web.service
|
||||
@@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=Iceshrimp Redis container
|
||||
[Container]
|
||||
Image=docker.io/redis:7.0-alpine
|
||||
ContainerName=iceshrimp_redis
|
||||
HostName=redis
|
||||
Network=iceshrimp.network
|
||||
Volume=%h/services/iceshrimp/redis:/data:Z
|
||||
[Service]
|
||||
Restart=on-failure
|
||||
TimeoutStartSec=900
|
||||
[Install]
|
||||
WantedBy=iceshrimp-web.service
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=Iceshrimp container
|
||||
[Container]
|
||||
Image=iceshrimp.dev/iceshrimp/iceshrimp:latest
|
||||
ContainerName=iceshrimp_web
|
||||
HostName=web
|
||||
PublishPort=3000:3000
|
||||
Network=iceshrimp.network
|
||||
Environment=NODE_ENV=production
|
||||
Volume=%h/services/iceshrimp/files:/iceshrimp/files:z
|
||||
Volume=%h/services/iceshrimp/.config:/iceshrimp/.config:ro,z
|
||||
[Service]
|
||||
Restart=on-failure
|
||||
TimeoutStartSec=900
|
||||
[Install]
|
||||
WantedBy=multi-user.target default.target
|
||||
@@ -0,0 +1 @@
|
||||
[Network]
|
||||
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
if [ -d $HOME/.config/containers/systemd ]; then
|
||||
mkdir -pv $(grep -F "Volume=" $HOME/.config/containers/systemd/iceshrimp-*.container | sed "s|%h|$HOME|g" | cut -d= -f2 | cut -d: -f1);
|
||||
|
||||
db_env=$(grep -F "EnvironmentFile=" $HOME/.config/containers/systemd/iceshrimp-db.container | sed "s|%h|$HOME|g" | cut -d= -f2)
|
||||
config_dir=$(grep -F ":/iceshrimp/.config" $HOME/.config/containers/systemd/iceshrimp-web.container | sed "s|%h|$HOME|g" | cut -d= -f2 | cut -d: -f1)
|
||||
|
||||
if [ ! -f $config_dir/docker_example.env ]; then
|
||||
wget -O $db_env \
|
||||
https://iceshrimp.dev/iceshrimp/iceshrimp/raw/branch/dev/.config/docker_example.env;
|
||||
else
|
||||
cp -v $config_dir/docker_example.env $db_env;
|
||||
fi
|
||||
|
||||
if [ ! -f $config_dir/example-docker.yml ]; then
|
||||
wget -O $config_dir/default.yml \
|
||||
https://iceshrimp.dev/iceshrimp/iceshrimp/raw/branch/dev/.config/example-docker.yml;
|
||||
else
|
||||
cp $config_dir/example-docker.yml $config_dir/default.yml
|
||||
fi
|
||||
else
|
||||
echo "No $HOME/.config/containers/systemd found"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user