forked from SocialFinanceDigitalLabs/liia-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile_LA
38 lines (26 loc) · 1.29 KB
/
Dockerfile_LA
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
FROM python:3.10-buster AS builder
RUN pip install poetry==1.4.2
ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache
WORKDIR /code
COPY pyproject.toml poetry.lock ./
RUN poetry install --without dev --no-root && rm -rf $POETRY_CACHE_DIR
# The runtime image, used to just run the code provided its virtual environment
FROM python:3.10-slim-buster AS runtime
ENV VIRTUAL_ENV=/code/.venv \
PATH="/code/.venv/bin:$PATH" \
PYTHONPATH="/code:${PYTHONPATH}"
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
COPY liiatools /code/liiatools
COPY liiatools_pipeline /code/liiatools_pipeline
# Copy the correct Repository File
COPY liiatools_pipeline/repository_la.py /code/liiatools_pipeline/repository.py
RUN apt-get update && apt-get install -y --no-install-recommends
# Clone the conf files into the docker container
EXPOSE 4000
# CMD allows this to be overridden from run launchers or executors that want
# to run other commands against your repository
# CMD ["dagster", "api", "grpc", "-h", "0.0.0.0", "-p", "4000", "-f", "/code/liiatools_pipeline/repository.py"]
CMD ["dagster", "code-server", "start", "--host", "0.0.0.0", "--port", "4000", "--python-file", "/code/liiatools_pipeline/repository.py", "-d", "/code/"]