Skip to content

Commit

Permalink
feat: added redis and other configs
Browse files Browse the repository at this point in the history
  • Loading branch information
kemboi22 committed Jun 27, 2024
1 parent 86ee8a2 commit dd535af
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ buildah config --entrypoint=/ \
--label="org.nethserver.authorizations=traefik@node:routeadm" \
--label="org.nethserver.tcp-ports-demand=1" \
--label="org.nethserver.rootfull=0" \
--label="org.nethserver.images=docker.io/postgres:15.5-alpine3.19 docker.io/formbricks/formbricks:2.3.0" \
--label="org.nethserver.images=docker.io/postgres:15.5-alpine3.19 docker.io/formbricks/formbricks:2.3.0 docker.io/library/redis:7" \
"${container}"
# Commit the image
buildah commit "${container}" "${repobase}/${reponame}"
Expand Down
3 changes: 2 additions & 1 deletion imageroot/systemd/user/formbricks-app.service
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[Unit]
Description=Podman formbricks-app.service
BindsTo=formbricks.service
After=formbricks.service postgresql-app.service
After=formbricks.service postgresql-app.service formbricks-redis.service

[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Expand All @@ -25,6 +25,7 @@ ExecStart=/usr/bin/podman run --conmon-pidfile %t/formbricks-app.pid \
--volume formbricks-app:/home/nextjs/apps/web/uploads/:Z \
--env-file=%S/state/bricks.env \
--env DATABASE_URL="postgresql://postgres:[email protected]:5432/formbricks?schema=public" \
--env REDIS_URL="redis://localhost:6379" \
${FORMBRICKS_IMAGE}
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/formbricks-app.ctr-id -t 10
ExecReload=/usr/bin/podman kill -s HUP formbricks-app
Expand Down
25 changes: 25 additions & 0 deletions imageroot/systemd/user/formbricks-redis.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[Unit]
Description=Podman formbricks-redis.service
BindsTo=formbricks.service
After=postgresql-app.service

[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
EnvironmentFile=%S/state/environment
Restart=always
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/formbricks-redis.pid %t/formbricks-redis.ctr-id
ExecStart=/usr/bin/podman run --conmon-pidfile %t/formbricks-redis.pid \
--cidfile %t/formbricks-redis.ctr-id \
--cgroups=no-conmon \
--pod-id-file %t/formbricks.pod-id --replace -d \
--name formbricks-redis \
-v formbricks-redis-data:/data \
${REDIS_IMAGE} --appendonly yes
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/formbricks-redis.ctr-id -t 10
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/formbricks-redis.ctr-id
PIDFile=%t/formbricks-redis.pid
Type=forking

[Install]
WantedBy=default.target
4 changes: 2 additions & 2 deletions imageroot/systemd/user/formbricks.service
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

[Unit]
Description=Podman formbricks.service
Requires=postgresql-app.service formbricks-app.service
Before=postgresql-app.service formbricks-app.service
Requires=postgresql-app.service formbricks-app.service formbricks-redis.service
Before=postgresql-app.service formbricks-app.service formbricks-redis.service

[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Expand Down

0 comments on commit dd535af

Please sign in to comment.