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