diff --git a/Dockerfile b/Dockerfile index f68befc05..a82071830 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,6 +44,11 @@ RUN apk add ffmpeg imagemagick exiftool ncurses postgresql-client file-dev libma COPY --from=BUILD /release /opt/akkoma/ ADD ./docker-entrypoint.sh /opt/akkoma/ EXPOSE 4000 + +VOLUME /opt/akkoma/uploads/ +VOLUME /opt/akkoma/instance/ +VOLUME /opt/akkoma/config/docker-config.exs + WORKDIR /opt/akkoma CMD [ "/opt/akkoma/docker-entrypoint.sh" ] \ No newline at end of file diff --git a/installation/quadlet/akkoma-postgresql.container b/installation/quadlet/akkoma-postgresql.container new file mode 100644 index 000000000..5f518ae4a --- /dev/null +++ b/installation/quadlet/akkoma-postgresql.container @@ -0,0 +1,23 @@ +# Put me at either: +# /usr/share/containers/systemd/akkoma-postgresql.container +# /etc/containers/systemd/akkoma-postgresql.container +# $HOME/.config/containers/systemd/akkoma-postgresql.container (for rootless podman!) + +[Unit] +Description=Akkoma's postgres database +After=local-fs.target + +[Container] +Image=docker.io/postgres:14 +PublishPort=4000 +Volume=/opt/akkoma/pgdata:/var/lib/postgresql/data:Z +AutoUpdate=registry +Environment=POSTGRES_DB=akkoma +Environment=POSTGRES_USER=akkoma +Environment=POSTGRES_PASSWORD=akkoma +ContainerName=db +Network=systemd-akkoma + +[Install] +# Start by default on boot +WantedBy=multi-user.target default.target \ No newline at end of file diff --git a/installation/quadlet/akkoma.container b/installation/quadlet/akkoma.container new file mode 100644 index 000000000..420055ce4 --- /dev/null +++ b/installation/quadlet/akkoma.container @@ -0,0 +1,26 @@ +# Put me at either: +# /usr/share/containers/systemd/akkoma.container +# /etc/containers/systemd/akkoma.container +# $HOME/.config/containers/systemd/akkoma.container (Recommended, for rootless podman!) + +[Unit] +Description=The main Akkoma container +After=local-fs.target akkoma-postgresql.container + +[Container] +Image=akkoma:latest +ExposeHostPort=4000 +# Comment the next line if you intend to use containerized caddy! +PublishPort=4000:4000 +Volume=/opt/akkoma/uploads:/opt/akkoma/uploads:Z +Volume=/opt/akkoma/instance:/opt/akkoma/instance:Z +Volume=/opt/akkoma/config.exs:/opt/akkoma/config/config.exs:Z +#AutoUpdate=registry +NoNewPrivileges=true +Environment=AKKOMA_CONFIG_PATH=/opt/akkoma/config/config.exs +ContainerName=akkoma +Network=systemd-akkoma + +[Install] +# Start by default on boot +WantedBy=multi-user.target default.target \ No newline at end of file diff --git a/installation/quadlet/akkoma.network b/installation/quadlet/akkoma.network new file mode 100644 index 000000000..b8c0f46fa --- /dev/null +++ b/installation/quadlet/akkoma.network @@ -0,0 +1,2 @@ +[Network] +Label=app=akkoma \ No newline at end of file diff --git a/installation/quadlet/caddy.container b/installation/quadlet/caddy.container new file mode 100644 index 000000000..8727a093f --- /dev/null +++ b/installation/quadlet/caddy.container @@ -0,0 +1,27 @@ +# Put me at either: +# /usr/share/containers/systemd/caddy.container +# /etc/containers/systemd/caddy.container +# !!!! PLEASE NOTE !!!! +# Caddy cannot run containerised in rootless podman, since it wants access +# to privileged ports 80 and 443! +# run caddy on your host if you're rootless! + +[Unit] +Description=Akkoma's postgres database +After=local-fs.target + +[Container] +Image=docker.io/caddy:2-alpine +PublishPort=80:80 +PublishPort=443:443 +ExposeHostPort=80 +ExposeHostPort=443 +Volume=/opt/akkoma/Caddyfile:/etc/caddy/Caddyfile +Volume=/opt/akkoma/caddy-data:/data +Volume=/opt/akkoma/caddy-config:/config +AutoUpdate=registry +Network=systemd-akkoma + +[Install] +# Start by default on boot +WantedBy=multi-user.target default.target \ No newline at end of file