improve dockerfiles and adjust code paths
This commit is contained in:
@@ -1,20 +1,25 @@
|
|||||||
FROM python:3.12-slim
|
FROM python:3.12-slim
|
||||||
|
|
||||||
RUN apt update && apt install --no-install-recommends --yes git
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||||
|
|
||||||
# Checkout and install dagster libraries needed to run the gRPC server
|
RUN apt-get update \
|
||||||
# exposing your repository to dagit and dagster-daemon, and to load the DagsterInstance
|
&& apt-get install --no-install-recommends --yes \
|
||||||
|
curl git \
|
||||||
|
&& apt-get clean \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
ENV PATH=/root/.local/bin:$PATH
|
||||||
|
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||||
|
|
||||||
|
WORKDIR /opt/dagster/home
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
|
|
||||||
RUN pip install uv
|
RUN uv pip install -r requirements.txt --system \
|
||||||
RUN uv pip install -r requirements.txt --system
|
&& uv pip install polars-lts-cpu --system
|
||||||
RUN uv pip install polars-lts-cpu --system
|
|
||||||
|
|
||||||
ARG APP
|
ARG APP
|
||||||
ENV APP=$APP
|
ENV APP=$APP
|
||||||
ENV PYTHONPATH=/apps/$APP/src/:/shared/src/:$PYTHONPATH
|
ENV PYTHONPATH=/code/apps/$APP/src/:/code/shared/src/:$PYTHONPATH
|
||||||
WORKDIR /opt/dagster/home
|
|
||||||
|
|
||||||
# Run dagster gRPC server on port 4000
|
# Run dagster gRPC server on port 4000
|
||||||
EXPOSE 4000
|
EXPOSE 4000
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
FROM mcr.microsoft.com/playwright:v1.54.0-noble
|
FROM mcr.microsoft.com/playwright:v1.54.0-noble
|
||||||
|
|
||||||
|
ARG APP
|
||||||
|
ENV APP=$APP
|
||||||
|
ENV PYTHONPATH=/apps/$APP/src/:/shared/src/:$PYTHONPATH
|
||||||
ENV PATH="/venv/bin:/root/.local/bin:$PATH"
|
ENV PATH="/venv/bin:/root/.local/bin:$PATH"
|
||||||
|
|
||||||
|
WORKDIR /opt/dagster/home
|
||||||
|
|
||||||
RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
|
RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
|
||||||
uv python install 3.12 && \
|
uv python install 3.12 && \
|
||||||
uv venv /venv
|
uv venv /venv
|
||||||
@@ -16,10 +21,7 @@ RUN . /venv/bin/activate && \
|
|||||||
uv pip install playwright && \
|
uv pip install playwright && \
|
||||||
playwright install
|
playwright install
|
||||||
|
|
||||||
ARG APP
|
|
||||||
ENV APP=$APP
|
|
||||||
ENV PYTHONPATH=/apps/$APP/src/:/shared/src/:$PYTHONPATH
|
|
||||||
WORKDIR /opt/dagster/home
|
|
||||||
|
|
||||||
# Run dagster gRPC server on port 4000
|
# Run dagster gRPC server on port 4000
|
||||||
EXPOSE 4000
|
EXPOSE 4000
|
||||||
|
|||||||
@@ -1,24 +1,25 @@
|
|||||||
FROM python:3.12-slim
|
FROM python:3.12-slim
|
||||||
|
|
||||||
# Install envsubst
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||||
RUN apt-get update && apt-get install -y gettext
|
|
||||||
|
|
||||||
# Dagster libraries to run both dagit and the dagster-daemon. Does not
|
RUN apt-get update \
|
||||||
# need to have access to any pipeline code.
|
&& apt-get install --no-install-recommends --yes \
|
||||||
|
curl gettext \
|
||||||
|
&& apt-get clean \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
ENV PATH=/root/.local/bin:$PATH
|
||||||
|
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||||
|
|
||||||
|
ENV DAGSTER_HOME=/opt/dagster/home/
|
||||||
|
WORKDIR $DAGSTER_HOME
|
||||||
COPY dagster-requirements.txt requirements.txt
|
COPY dagster-requirements.txt requirements.txt
|
||||||
|
|
||||||
RUN pip install uv
|
RUN uv pip install -r requirements.txt --system \
|
||||||
RUN uv pip install -r requirements.txt --system
|
&& uv pip install polars-lts-cpu --system
|
||||||
RUN uv pip install polars-lts-cpu --system
|
|
||||||
|
|
||||||
# Set $DAGSTER_HOME and copy dagster instance and workspace YAML there
|
|
||||||
ENV DAGSTER_HOME=/opt/dagster/home/
|
|
||||||
|
|
||||||
RUN mkdir -p $DAGSTER_HOME
|
RUN mkdir -p $DAGSTER_HOME
|
||||||
|
|
||||||
# COPY dagster.yaml workspace.yaml $DAGSTER_HOME
|
|
||||||
|
|
||||||
# Create entrypoint that renders the dagster.yaml from a template
|
# Create entrypoint that renders the dagster.yaml from a template
|
||||||
RUN cat << 'EOF' > /entrypoint.sh
|
RUN cat << 'EOF' > /entrypoint.sh
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
@@ -33,6 +34,4 @@ EOF
|
|||||||
RUN chmod +x /entrypoint.sh
|
RUN chmod +x /entrypoint.sh
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|
||||||
ENV PYTHONPATH=/system:$PYTHONPATH
|
ENV PYTHONPATH=/code/system:$PYTHONPATH
|
||||||
|
|
||||||
WORKDIR $DAGSTER_HOME
|
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ services:
|
|||||||
<<: [ *dagster_env, *email_env ]
|
<<: [ *dagster_env, *email_env ]
|
||||||
DAGSTER_CURRENT_IMAGE: dagster-code-vinyl
|
DAGSTER_CURRENT_IMAGE: dagster-code-vinyl
|
||||||
volumes:
|
volumes:
|
||||||
- /opt/dagster/apps/:/apps/:ro
|
- /opt/dagster/apps/:/code/apps/:ro
|
||||||
- /opt/dagster/shared/:/shared/:ro
|
- /opt/dagster/shared/:/code/shared/:ro
|
||||||
- /opt/dagster/logs/:/logs:rw
|
- /opt/dagster/logs/:/logs:rw
|
||||||
- /opt/dagster/storage/import/:/storage/import/:ro
|
- /opt/dagster/storage/import/:/storage/import/:ro
|
||||||
- /opt/dagster/storage/deals/:/storage/deals/:rw
|
- /opt/dagster/storage/deals/:/storage/deals/:rw
|
||||||
@@ -53,8 +53,8 @@ services:
|
|||||||
<<: [ *dagster_env ]
|
<<: [ *dagster_env ]
|
||||||
DAGSTER_CURRENT_IMAGE: dagster-code-stocks
|
DAGSTER_CURRENT_IMAGE: dagster-code-stocks
|
||||||
volumes:
|
volumes:
|
||||||
- /opt/dagster/apps/:/apps/:ro
|
- /opt/dagster/apps/:/code/apps/:ro
|
||||||
- /opt/dagster/shared/:/shared/:ro
|
- /opt/dagster/shared/:/code/shared/:ro
|
||||||
- /opt/dagster/logs/:/logs:rw
|
- /opt/dagster/logs/:/logs:rw
|
||||||
networks:
|
networks:
|
||||||
- dagster
|
- dagster
|
||||||
@@ -81,8 +81,8 @@ services:
|
|||||||
<<: [ *dagster_env ]
|
<<: [ *dagster_env ]
|
||||||
DAGSTER_CURRENT_IMAGE: dagster-code-tesla
|
DAGSTER_CURRENT_IMAGE: dagster-code-tesla
|
||||||
volumes:
|
volumes:
|
||||||
- /opt/dagster/apps/:/apps/:ro
|
- /opt/dagster/apps/:/code/apps/:ro
|
||||||
- /opt/dagster/shared/:/shared/:ro
|
- /opt/dagster/shared/:/code/shared/:ro
|
||||||
- /opt/dagster/logs/:/logs:rw
|
- /opt/dagster/logs/:/logs:rw
|
||||||
networks:
|
networks:
|
||||||
- dagster
|
- dagster
|
||||||
@@ -100,8 +100,8 @@ services:
|
|||||||
<<: [ *dagster_env ]
|
<<: [ *dagster_env ]
|
||||||
DAGSTER_CURRENT_IMAGE: dagster-code-weather
|
DAGSTER_CURRENT_IMAGE: dagster-code-weather
|
||||||
volumes:
|
volumes:
|
||||||
- /opt/dagster/apps/:/apps/:ro
|
- /opt/dagster/apps/:/code/apps/:ro
|
||||||
- /opt/dagster/shared/:/shared/:ro
|
- /opt/dagster/shared/:/code/shared/:ro
|
||||||
- /opt/dagster/logs/:/logs:rw
|
- /opt/dagster/logs/:/logs:rw
|
||||||
networks:
|
networks:
|
||||||
- dagster
|
- dagster
|
||||||
@@ -119,8 +119,8 @@ services:
|
|||||||
<<: [ *dagster_env ]
|
<<: [ *dagster_env ]
|
||||||
DAGSTER_CURRENT_IMAGE: dagster-code-other
|
DAGSTER_CURRENT_IMAGE: dagster-code-other
|
||||||
volumes:
|
volumes:
|
||||||
- /opt/dagster/apps/:/apps/:ro
|
- /opt/dagster/apps/:/code/apps/:ro
|
||||||
- /opt/dagster/shared/:/shared/:ro
|
- /opt/dagster/shared/:/code/shared/:ro
|
||||||
- /opt/dagster/logs/:/logs:rw
|
- /opt/dagster/logs/:/logs:rw
|
||||||
networks:
|
networks:
|
||||||
- dagster
|
- dagster
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ x-volumes: &volumes
|
|||||||
volumes:
|
volumes:
|
||||||
- /opt/dagster/dagster.yaml:/opt/dagster/home/dagster.yaml.template:ro
|
- /opt/dagster/dagster.yaml:/opt/dagster/home/dagster.yaml.template:ro
|
||||||
- /opt/dagster/workspace.yaml:/opt/dagster/home/workspace.yaml:ro
|
- /opt/dagster/workspace.yaml:/opt/dagster/home/workspace.yaml:ro
|
||||||
- /opt/dagster/system/:/system/:ro
|
- /opt/dagster/system/:/code/system/:ro
|
||||||
- /opt/dagster/storage/:/storage/:rw
|
- /opt/dagster/storage/:/storage/:rw
|
||||||
- /opt/dagster/logs/:/logs:rw
|
- /opt/dagster/logs/:/logs:rw
|
||||||
- /var/run/docker.sock:/var/run/docker.sock:rw
|
- /var/run/docker.sock:/var/run/docker.sock:rw
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ run_launcher:
|
|||||||
container_kwargs:
|
container_kwargs:
|
||||||
auto_remove: true
|
auto_remove: true
|
||||||
volumes:
|
volumes:
|
||||||
- /opt/dagster/shared/:/shared/:ro
|
- /opt/dagster/apps/:/code/apps/:ro
|
||||||
- /opt/dagster/apps/:/apps:ro
|
- /opt/dagster/shared/:/code/shared/:ro
|
||||||
- /opt/dagster/storage/:/storage/:rw
|
- /opt/dagster/storage/:/storage/:rw
|
||||||
- /opt/dagster/logs/:/logs:rw
|
- /opt/dagster/logs/:/logs:rw
|
||||||
- ${CACHE_DIR}:/cache:rw
|
- ${CACHE_DIR}:/cache:rw
|
||||||
|
|||||||
Reference in New Issue
Block a user