-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.bot
40 lines (32 loc) · 1.3 KB
/
Dockerfile.bot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
FROM python:3.12-slim AS build-env
WORKDIR /app
ENV WORKDIR "/app"
COPY ./bot_app/src/requirements.txt requirements.txt
RUN pip install --upgrade pip \
&& pip install -r ${WORKDIR}/requirements.txt \
&& mkdir -p ${WORKDIR}/logs
#FROM gcr.io/distroless/python3
# I can't use distroless now because an image is old:
# It has a bug in pydantic:
# ModuleNotFoundError: No module named 'pydantic_core._pydantic_core'
# It can be used with python3.11 but my code works only with 3.12.
#WORKDIR /app
ENV WORKDIR "/app"
ENV LOG_ENV "prod"
ENV LOG_LEVEL "debug"
ENV PRIVATE_KEY_FILEPATH "${WORKDIR}/keys/private_key.pem"
ENV PUBLIC_KEY_FILEPATH "${WORKDIR}/keys/public_key.pem"
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PYTHONPATH "${PYTHONPATH}:${WORKDIR}"
# ENV PYTHONPATH "${PYTHONPATH}:${WORKDIR}:/usr/local/lib/python3.12/site-packages"
#COPY --from=build-env /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
#COPY --from=build-env ${WORKDIR}/logs ${WORKDIR}/logs
COPY ./bot_app/src ./bot_app/src
COPY ./auth_app ./auth_app
COPY ./db ./db
COPY ./project_settings ./project_settings
COPY ./helpers ./helpers
COPY ./social_ai_profile_app ./social_ai_profile_app
COPY ./alembic.ini ./alembic.ini
CMD ["/bin/sh", "-c", "alembic upgrade head && python3 bot_app/src/main.py"]