From 29afd7373724d454d2722942d26a832947dfc450 Mon Sep 17 00:00:00 2001 From: threnjen Date: Tue, 15 Oct 2024 15:10:56 -0700 Subject: [PATCH] update dockerfile --- Dockerfiles/Dockerfile.bgg_orchestrator | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/Dockerfiles/Dockerfile.bgg_orchestrator b/Dockerfiles/Dockerfile.bgg_orchestrator index ef843ba..646a7a2 100644 --- a/Dockerfiles/Dockerfile.bgg_orchestrator +++ b/Dockerfiles/Dockerfile.bgg_orchestrator @@ -9,25 +9,33 @@ RUN apt-get update && apt-get install -y \ # Install pipenv RUN pip3 install pipenv +# Create the necessary directory for the application and dagster runs +RUN mkdir -p /app/aws_dagster_bgg/dagster_runs + +# Set the working directory +WORKDIR /app + +# Copy the Pipfile and other dependency files first to leverage Docker layer caching +COPY aws_dagster_bgg/Pipfile* ./ +COPY aws_dagster_bgg/pyproject.toml ./ + +# Install dependencies with pipenv +RUN pipenv install --deploy --ignore-pipfile + # Copy the source code into the container -# COPY data game_data_scraper/data COPY aws_dagster_bgg aws_dagster_bgg COPY utils utils -COPY aws_dagster_bgg/Pipfile* . COPY config.py . COPY dagster_cloud.yaml . -COPY aws_dagster_bgg/pyproject.toml . -RUN MKDIR -p aws_dagster_bgg/dagster_runs - -# Install dependencies with pipenv -RUN pipenv sync +# Set environment variables with ARG for build-time and ENV for runtime ARG ENV ENV ENV=$ENV ARG ASSET ENV ASSET=$ASSET +# Expose the port (if needed for the service) EXPOSE 3000 # Set the entry point and command