Compare commits
1 Commits
main
...
generated-
Author | SHA1 | Date |
---|---|---|
Kiara Grouwstra | 02d57b080c |
|
@ -0,0 +1,156 @@
|
|||
# Auto-generated using compose2nix v0.1.6.
|
||||
{ pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
# Runtime
|
||||
virtualisation.podman = {
|
||||
enable = true;
|
||||
autoPrune.enable = true;
|
||||
dockerCompat = true;
|
||||
defaultNetwork.settings = {
|
||||
# Required for container networking to be able to use names.
|
||||
dns_enabled = true;
|
||||
};
|
||||
};
|
||||
virtualisation.oci-containers.backend = "podman";
|
||||
|
||||
# Containers
|
||||
virtualisation.oci-containers.containers."civi-civi" = {
|
||||
image = "civicrm:latest";
|
||||
environment = {
|
||||
CIVI_DB_NAME = "";
|
||||
DB_ADMIN_PASSWORD = "";
|
||||
DB_ROOT_PASSWORD = "";
|
||||
DEBUG = "true";
|
||||
TZ = "";
|
||||
WORDPRESS_ADMIN_EMAIL = "";
|
||||
WORDPRESS_ADMIN_PASSWORD = "";
|
||||
WORDPRESS_ADMIN_USER = "";
|
||||
WORDPRESS_DB_HOST = "db";
|
||||
WORDPRESS_DB_NAME = "";
|
||||
WORDPRESS_DB_PASSWORD = "";
|
||||
WORDPRESS_DB_USER = "";
|
||||
WORDPRESS_HOST = "";
|
||||
WORDPRESS_NAME = "";
|
||||
};
|
||||
volumes = [
|
||||
"civi-data:/usr/src/wordpress:rw"
|
||||
];
|
||||
ports = [
|
||||
"8080:80/tcp"
|
||||
];
|
||||
log-driver = "journald";
|
||||
extraOptions = [
|
||||
"--network-alias=civi"
|
||||
"--network=civi-default"
|
||||
];
|
||||
};
|
||||
systemd.services."podman-civi-civi" = {
|
||||
serviceConfig = {
|
||||
Restart = lib.mkOverride 500 "no";
|
||||
};
|
||||
after = [
|
||||
"podman-network-civi-default.service"
|
||||
];
|
||||
requires = [
|
||||
"podman-network-civi-default.service"
|
||||
];
|
||||
partOf = [
|
||||
"podman-compose-civi-root.target"
|
||||
];
|
||||
wantedBy = [
|
||||
"podman-compose-civi-root.target"
|
||||
];
|
||||
};
|
||||
virtualisation.oci-containers.containers."civi-db" = {
|
||||
image = "mariadb:10.9.4";
|
||||
environment = {
|
||||
MARIADB_DATABASE = "";
|
||||
MARIADB_PASSWORD = "";
|
||||
MARIADB_ROOT_PASSWORD = "";
|
||||
MARIADB_USER = "";
|
||||
};
|
||||
volumes = [
|
||||
"db-data:/var/lib/mysql:rw"
|
||||
];
|
||||
log-driver = "journald";
|
||||
extraOptions = [
|
||||
"--network-alias=db"
|
||||
"--network=civi-default"
|
||||
];
|
||||
};
|
||||
systemd.services."podman-civi-db" = {
|
||||
serviceConfig = {
|
||||
Restart = lib.mkOverride 500 "no";
|
||||
};
|
||||
after = [
|
||||
"podman-network-civi-default.service"
|
||||
];
|
||||
requires = [
|
||||
"podman-network-civi-default.service"
|
||||
];
|
||||
partOf = [
|
||||
"podman-compose-civi-root.target"
|
||||
];
|
||||
wantedBy = [
|
||||
"podman-compose-civi-root.target"
|
||||
];
|
||||
};
|
||||
virtualisation.oci-containers.containers."civi-webserver" = {
|
||||
image = "nginx:latest";
|
||||
volumes = [
|
||||
"/home/kiara/Downloads/bij1/civicrm-bij1/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro"
|
||||
"civi-data:/usr/src/wordpress:rw"
|
||||
];
|
||||
ports = [
|
||||
"8000:80/tcp"
|
||||
];
|
||||
log-driver = "journald";
|
||||
extraOptions = [
|
||||
"--network-alias=webserver"
|
||||
"--network=civi-default"
|
||||
];
|
||||
};
|
||||
systemd.services."podman-civi-webserver" = {
|
||||
serviceConfig = {
|
||||
Restart = lib.mkOverride 500 "no";
|
||||
};
|
||||
after = [
|
||||
"podman-network-civi-default.service"
|
||||
];
|
||||
requires = [
|
||||
"podman-network-civi-default.service"
|
||||
];
|
||||
partOf = [
|
||||
"podman-compose-civi-root.target"
|
||||
];
|
||||
wantedBy = [
|
||||
"podman-compose-civi-root.target"
|
||||
];
|
||||
};
|
||||
|
||||
# Networks
|
||||
systemd.services."podman-network-civi-default" = {
|
||||
path = [ pkgs.podman ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
ExecStop = "${pkgs.podman}/bin/podman network rm -f civi-default";
|
||||
};
|
||||
script = ''
|
||||
podman network inspect civi-default || podman network create civi-default --opt isolate=true
|
||||
'';
|
||||
partOf = [ "podman-compose-civi-root.target" ];
|
||||
wantedBy = [ "podman-compose-civi-root.target" ];
|
||||
};
|
||||
|
||||
# Root service
|
||||
# When started, this will automatically create all resources and start
|
||||
# the containers. When stopped, this will teardown all resources.
|
||||
systemd.targets."podman-compose-civi-root" = {
|
||||
unitConfig = {
|
||||
Description = "Root target generated by compose2nix.";
|
||||
};
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue