-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcanaille.nix
36 lines (33 loc) · 968 Bytes
/
canaille.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ pkgs ? import <nixpkgs> {} }:
pkgs.dockerTools.buildImage {
name = "canaille";
tag = "latest";
copyToRoot = pkgs.buildEnv {
name = "canaille-env";
paths = [
pkgs.bashInteractive
pkgs.python3
pkgs.python3Packages.setuptools
pkgs.python3Packages.pip
pkgs.coreutils-full
];
};
config = {
Cmd = [
"/bin/sh"
"-c"
"
python3 -m venv /opt/canaille/venv && \
. /opt/canaille/venv/bin/activate && \
pip install canaille[front,oidc,postgresql,server,otp,sms,scim] && \
mkdir -p /opt/canaille && \
echo 'bind = [\"0.0.0.0:5000\"]' > /opt/canaille/hypercorn.toml && \
canaille install && \
canaille create user --user-name admin --password admin && \
canaille create group --display-name admin --members admin && \
canaille run --config /opt/canaille/hypercorn.toml
"
];
ExposedPorts = { "5000/tcp" = { }; };
};
}