This commit is contained in:
18
flake.nix
18
flake.nix
@@ -95,19 +95,7 @@
|
|||||||
|
|
||||||
packages = forAllSystems (system: let
|
packages = forAllSystems (system: let
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
pythonSet = pythonSets.${system}.overrideScope editableOverlay;
|
virtualenv = pythonSets.${system}.mkVirtualEnv "document-service-env" workspace.deps.default;
|
||||||
virtualenv = pythonSet.mkVirtualEnv "document-service-env" workspace.deps.default;
|
|
||||||
|
|
||||||
# Create a derivation that includes the application code
|
|
||||||
appCode = pkgs.stdenv.mkDerivation {
|
|
||||||
name = "document-service-code";
|
|
||||||
src = ./.;
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/app
|
|
||||||
cp -r app/* $out/app/
|
|
||||||
cp pyproject.toml $out/
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
in {
|
in {
|
||||||
default = virtualenv;
|
default = virtualenv;
|
||||||
dockerImage = pkgs.dockerTools.buildLayeredImage {
|
dockerImage = pkgs.dockerTools.buildLayeredImage {
|
||||||
@@ -119,13 +107,12 @@
|
|||||||
pkgs.shadow
|
pkgs.shadow
|
||||||
pkgs.file
|
pkgs.file
|
||||||
pkgs.git # Include git for version info
|
pkgs.git # Include git for version info
|
||||||
appCode # Include application code
|
|
||||||
];
|
];
|
||||||
config = {
|
config = {
|
||||||
Cmd = ["/bin/python" "-m" "uvicorn" "app.main:app" "--host" "0.0.0.0" "--port" "8082"];
|
Cmd = ["/bin/python" "-m" "uvicorn" "app.main:app" "--host" "0.0.0.0" "--port" "8082"];
|
||||||
Env = [
|
Env = [
|
||||||
"PYTHONUNBUFFERED=1"
|
"PYTHONUNBUFFERED=1"
|
||||||
"PYTHONPATH=/app"
|
"LD_LIBRARY_PATH=${pkgs.file.out}/lib"
|
||||||
"S3_ENDPOINT"
|
"S3_ENDPOINT"
|
||||||
"S3_ACCESS_KEY"
|
"S3_ACCESS_KEY"
|
||||||
"S3_SECRET_KEY"
|
"S3_SECRET_KEY"
|
||||||
@@ -135,7 +122,6 @@
|
|||||||
"PORT"
|
"PORT"
|
||||||
"LOG_LEVEL"
|
"LOG_LEVEL"
|
||||||
];
|
];
|
||||||
WorkingDir = "/app";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -56,23 +56,3 @@ service:
|
|||||||
port: 8082
|
port: 8082
|
||||||
protocol: HTTP
|
protocol: HTTP
|
||||||
|
|
||||||
external-secret:
|
|
||||||
enabled: true
|
|
||||||
apiVersion: external-secrets.io/v1
|
|
||||||
kind: ExternalSecret
|
|
||||||
suffix: secrets
|
|
||||||
spec:
|
|
||||||
spec:
|
|
||||||
refreshInterval: 0s
|
|
||||||
secretStoreRef:
|
|
||||||
name: cluster-secrets-store
|
|
||||||
kind: ClusterSecretStore
|
|
||||||
target:
|
|
||||||
name: '{{ include "bjw.common.lib.chart.names.fullname $ }}-secrets'
|
|
||||||
creationPolicy: Owner
|
|
||||||
dataFrom:
|
|
||||||
- sourceRef:
|
|
||||||
generatorRef:
|
|
||||||
apiVersion: generators.external-secrets.io/v1alpha1
|
|
||||||
kind: Password
|
|
||||||
name: '{{ include "bjw.common.lib.chart.names.fullname $ }}-password-generator'
|
|
||||||
|
|||||||
Reference in New Issue
Block a user