-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.workers
32 lines (23 loc) · 935 Bytes
/
Dockerfile.workers
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
FROM python:3.11 as requirements-stage
WORKDIR /tmp
RUN pip install poetry
COPY ./pyproject.toml ./poetry.lock* /tmp/
RUN poetry export -f requirements.txt --output requirements.txt --without-hashes --with development
FROM python:3.11 as build-stage
WORKDIR /code
ARG ENV
COPY --from=requirements-stage /tmp/requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
RUN pip install poetry
RUN poetry config virtualenvs.create false
COPY pyproject.toml poetry.lock* /code/
RUN poetry install --no-interaction --no-ansi
COPY ./ai_platform /code/ai_platform
COPY .env.* /code/
COPY ./scripts/worker_initialize.sh /code/worker_initialize.sh
COPY ./scripts/worker_entrypoint.sh /code/worker_entrypoint.sh
RUN chmod +x /code/worker_entrypoint.sh
RUN chmod +x /code/worker_initialize.sh
# Execute worker initialization script
RUN ./worker_initialize.sh
CMD ["./worker_entrypoint.sh"]