Initial commit
Some checks failed
/ build (push) Failing after 23s

This commit is contained in:
phil 2024-10-27 02:09:13 +02:00
parent 1da1965b3c
commit 5b5258428b
7 changed files with 72 additions and 27 deletions

View file

@ -1,12 +1,29 @@
FROM localhost/trixie_python
WORKDIR /usr/src/treetrail
ENV PATH="/usr/src/treetrail/.venv/bin:$PATH"
ENV PYTHONPATH="/usr/src"
COPY --from=localhost/treetrail_backend_deps /usr/src/treetrail/.venv/ /usr/src/treetrail/.venv
COPY --from=localhost/treetrail_backend_deps /usr/local/treetrail/ /usr/local/treetrail
COPY ./treetrail ./pyproject.toml ./README.md .
ENV PYTHONPATH $UV_PROJECT_ENVIRONMENT/lib/python3.12/site-packages
ENV PATH=/app/bin:$PATH
RUN <<EOT
groupadd -r app
useradd -r -d /app -g app -N app
mkdir /var/lib/treetrail
chown app: /var/lib/treetrail
EOT
COPY --from=localhost/treetrail-backend-base --chown=app:app /app /app
USER app
WORKDIR /app
# Instances should override the prod.yaml file
COPY ./prod.yaml /etc/treetrail/prod.yaml
#COPY ./prod.yaml /etc/treetrail/prod.yaml
#COPY ./dist/treetrail_backend-0.3.0.tar.gz /src/
CMD ["uvicorn", "treetrail.application:app", "--port", "8081", "--log-config", "logging.yaml", "--host", "0.0.0.0"]
#RUN uv pip install /src/treetrail_backend-0.3.0.tar.gz
CMD [ \
"uvicorn", "treetrail.application:app", \
"--port", "8081", \
#"--log-config", "/app/config/logging.yaml", \
"--host", "0.0.0.0" \
]