mirror of
https://github.com/Noratrieb/vps.git
synced 2026-01-16 09:35:10 +01:00
hugo-chat works
This commit is contained in:
parent
b58d3f4ceb
commit
e60ecf1f91
14 changed files with 43 additions and 64 deletions
|
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
dockerLogin = {
|
||||
registry = "docker.noratrieb.dev";
|
||||
|
|
@ -10,68 +10,46 @@ in
|
|||
age.secrets.hugochat_db_password.file = ../../secrets/hugochat_db_password.age;
|
||||
|
||||
virtualisation.oci-containers.containers = {
|
||||
/*
|
||||
hugo_chat_client:
|
||||
container_name: hugo-chat-client
|
||||
image: "docker.noratrieb.dev/hugo-chat-client:63bd1922"
|
||||
restart: always
|
||||
ports:
|
||||
- "5002:80"
|
||||
*/
|
||||
hugo-chat-client = {
|
||||
image = "docker.noratrieb.dev/hugo-chat-client:63bd1922";
|
||||
image = "docker.noratrieb.dev/hugo-chat-client:89ce0b07";
|
||||
login = dockerLogin;
|
||||
ports = [ "127.0.0.1:5002:80" ];
|
||||
};
|
||||
/*
|
||||
hugo_chat_server:
|
||||
container_name: hugo-chat-server
|
||||
image: "docker.noratrieb.dev/hugo-chat-server:63bd1922"
|
||||
ports:
|
||||
- "5001:8080"
|
||||
environment:
|
||||
SPRING_DATASOURCE_URL: "jdbc:postgresql://hugo-chat-db:5432/hugochat"
|
||||
SPRING_DATASOURCE_PASSWORD: "${HUGO_CHAT_DB_PASSWORD}"
|
||||
networks:
|
||||
- hugo-chat
|
||||
*/
|
||||
# disabled since the DB connection doesn't work yet.
|
||||
#hugo-chat-server = {
|
||||
# image = "docker.noratrieb.dev/hugo-chat-server:63bd1922";
|
||||
# ports = [ "5001:80" ];
|
||||
# environment = {
|
||||
# SPRING_DATASOURCE_URL = "jdbc:postgresql://vps1.local:5003/hugochat";
|
||||
# };
|
||||
# environmentFiles = [ config.age.secrets.hugochat_db_password.path ];
|
||||
# login = dockerLogin;
|
||||
#};
|
||||
|
||||
/*
|
||||
hugo_chat_db:
|
||||
container_name: hugo-chat-db
|
||||
image: "postgres:latest"
|
||||
restart: always
|
||||
volumes:
|
||||
- "/apps/hugo-chat/data:/var/lib/postgresql/data"
|
||||
environment:
|
||||
POSTGRES_PASSWORD: "${HUGO_CHAT_DB_PASSWORD}"
|
||||
PGDATA: "/var/lib/postgresql/data/pgdata"
|
||||
networks:
|
||||
- hugo-chat
|
||||
*/
|
||||
hugo-chat-server = {
|
||||
image = "docker.noratrieb.dev/hugo-chat-server:89ce0b07";
|
||||
ports = [ "127.0.0.1:5001:8080" ];
|
||||
environment = {
|
||||
SPRING_DATASOURCE_URL = "jdbc:postgresql://hugo-chat-db:5432/postgres";
|
||||
};
|
||||
environmentFiles = [ config.age.secrets.hugochat_db_password.path ];
|
||||
extraOptions = [ "--network=hugo-chat" ];
|
||||
|
||||
dependsOn = [ "hugo-chat-db" ];
|
||||
login = dockerLogin;
|
||||
};
|
||||
|
||||
hugo-chat-db = {
|
||||
image = "postgres:16";
|
||||
ports = [ "127.0.0.1:5003:80" ];
|
||||
volumes = [ "/var/lib/hugo-chat/data:/var/lib/postgresql/data" ];
|
||||
environment = {
|
||||
POSTGRES_PASSWORD = "\${HUGO_CHAT_DB_PASSWORD}";
|
||||
PGDATA = "/var/lib/postgresql/data/pgdata";
|
||||
};
|
||||
extraOptions = [ "--network=hugo-chat" ];
|
||||
environmentFiles = [ config.age.secrets.hugochat_db_password.path ];
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
# https://www.reddit.com/r/NixOS/comments/13e5w6b/does_anyone_have_a_working_nixos_ocicontainers/
|
||||
systemd.services.init-hugo-chat-podman-network = {
|
||||
description = "Create the network bridge for hugo-chat.";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig.Type = "oneshot";
|
||||
script = ''
|
||||
${lib.getExe pkgs.podman} network create hugo-chat || true
|
||||
'';
|
||||
};
|
||||
system.activationScripts.makeHugoChatDir = lib.stringAfter [ "var" ] ''
|
||||
mkdir -p /var/lib/hugo-chat/data
|
||||
'';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue