diff --git a/Dockerfile b/Dockerfile index 6cf38d8..0b0757d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ FROM python:3.11-rc-alpine ENV cloud_name raincloud +ENV worker_timeout 300 COPY . /tmp/raincloud @@ -12,4 +13,4 @@ RUN rm -rf /tmp/raincloud EXPOSE 8000/tcp -ENTRYPOINT . /opt/venv/bin/activate && gunicorn --bind=0.0.0.0:8000 "raincloud:create_app(base_path='/var/www/raincloud',cloud_name='${cloud_name}')" \ No newline at end of file +ENTRYPOINT . /opt/venv/bin/activate && gunicorn --timeout ${worker_timeout} --bind=0.0.0.0:8000 "raincloud:create_app(base_path='/var/www/raincloud',cloud_name='${cloud_name}')" \ No newline at end of file diff --git a/flake.nix b/flake.nix index c5f6590..c63799d 100644 --- a/flake.nix +++ b/flake.nix @@ -61,6 +61,13 @@ type = types.str; description = "Base path of the raincloud"; }; + + workerTimeout = mkOption { + type = types.int; + default = 300; + example = 360; + description = "Gunicorn worker timeout"; + }; }; config = mkIf cfg.enable { @@ -91,7 +98,7 @@ ExecStart = '' ${gunicorn}/bin/gunicorn "raincloud:create_app('${cfg.basePath}', '${cfg.cloudName}')" \ - --timeout 300 \ + --timeout ${cfg.workerTimeout} \ --bind=${cfg.address}:${toString cfg.port} ''; };