diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..0b1e1e7 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,27 @@ +**/__pycache__ +**/.venv +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/bin +**/charts +**/docker-compose* +**/compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8cbb569 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM python:3 AS build + +COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ + +WORKDIR /app +RUN uv venv + +COPY requirements.txt . +RUN uv pip install --system -r requirements.txt + +# Copy the project into the intermediate image +ADD . /app + +FROM python:3-slim +# Copy the environment, but not the source code +COPY --from=build --chown=app:app /app/.venv /app/.venv + +RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app +USER appuser + +CMD ["python", "scl.py"] \ No newline at end of file