Commit e8fa24c1 authored by Profpatsch's avatar Profpatsch

containers: add sanghaApi docker container

The API is our main backend service.
parent 47ad60d4
......@@ -8,12 +8,14 @@ let
./modules/docker-images.nix
./postgres.nix
./rabbitmq.nix
./sangha-api.nix
];
config = {
# enable docker image generation
org.techcultivation.deploy.database.dockerImage.enable = true;
org.techcultivation.deploy.queue.dockerImage.enable = true;
org.techcultivation.deploy.api.dockerImage.enable = true;
# our own packages
nixpkgs.overlays = [(self: _: {
......@@ -81,6 +83,7 @@ in {
postgres = evalDeploy.config.generated.dockerImages.sanghaPostgres;
postgresDev = evalDev.config.generated.dockerImages.sanghaPostgres;
rabbitmq = evalDeploy.config.generated.dockerImages.sanghaRabbitmq;
api = evalDeploy.config.generated.dockerImages.sanghaApi;
};
# FIXME: evalDev is implicitely needed, otherwise the test
# doesn’t get the mock database.
......
{ lib, pkgs, config, ... }:
let
cfg = config.org.techcultivation.deploy.api;
in {
options.org.techcultivation.deploy.api = {
dockerImage.enable = lib.mkEnableOption "sangha API docker image";
};
config = lib.mkIf cfg.dockerImage.enable {
generated.dockerImages.sanghaApi =
pkgs.helpers.createStandaloneDockerImage {
name = "sangha-api";
tag = "deployment";
description = "TODO";
contents = [
pkgs.sangha
];
config = {
User = "sangha-api";
Cmd = [ "/bin/sangha" ];
ExposedPorts."${toString 9991}/tcp" = {};
};
rootSetupScript = "";
};
};
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment