-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (33 loc) · 1.55 KB
/
Copy pathDockerfile
File metadata and controls
42 lines (33 loc) · 1.55 KB
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
41
42
FROM python:3.11-slim
# System environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
POETRY_VERSION=2.4.1 \
POETRY_HOME="/opt/poetry" \
POETRY_VIRTUALENVS_CREATE=false \
DAGSTER_HOME="/opt/dagster/dagster_home" \
PYTHONPATH="/opt/dagster/app" \
DAGSTER_SENSOR_GRPC_TIMEOUT_SECONDS=300
# Add Poetry to PATH
ENV PATH="$POETRY_HOME/bin:$PATH"
# Install system dependencies needed for Poetry and PostgreSQL
RUN apt-get update && apt-get install -y \
curl \
build-essential \
libpq-dev \
&& curl -sSL https://install.python-poetry.org | python3 - \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /opt/dagster/app
# Copy dependency management files first to leverage Docker layer caching
COPY pyproject.toml README.md poetry.lock* ./
# Copy internal project directories into the container
COPY sds_data_manager/ ./sds_data_manager/
RUN poetry install --with layer-database && poetry install --with layer-spice && poetry install --with layer-processing && poetry install --with cdk-install
# Set up the Dagster home directory and copy the system configuration
# Dagster looks for dagster.yaml in $DAGSTER_HOME
RUN mkdir -p $DAGSTER_HOME && cp sds_data_manager/orchestration/dagster.yaml $DAGSTER_HOME/
# The CMD is technically overridden by the CDK for the Webserver and Daemon tasks,
# but providing a default makes the image easier to test locally.
CMD ["dagster-webserver", "--read-only", "-h", "0.0.0.0", "-p", "3000", "-w", "sds_data_manager/orchestration/workspace.yaml"]