This commit is contained in:
ryana mittens 2024-09-06 11:31:48 +08:00
commit 39f67b45de
2 changed files with 14 additions and 1 deletions

View file

@ -1,6 +1,10 @@
# base layer
FROM python:3.12-alpine as base
# create a venv
ARG DEV=false
ENV VIRTUAL_ENV=/sparkle/.venv \
PATH="/sparkle/.venv/bin:$PATH"
@ -26,6 +30,7 @@ RUN pip install poetry==1.8.3
# Install the app
COPY pyproject.toml poetry.lock ./
RUN poetry install --no-root && rm -rf $POETRY_CACHE_DIR;
FROM base as runtime
@ -34,5 +39,6 @@ COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
COPY app ./app
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]

View file

@ -7,3 +7,10 @@ services:
environment: # use .env
- FINNHUB_API_KEY=${FINNHUB_API_KEY}
restart: unless-stopped
networks:
- yanacloud
networks:
yanacloud:
external: true
name: yanacloud