From 92bd7c162c88fd6ba4a9fe6de5c87e1c5003be62 Mon Sep 17 00:00:00 2001 From: kls Date: Mon, 6 May 2024 17:12:10 -0500 Subject: [PATCH] Update for .env local build --- Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Dockerfile b/Dockerfile index a961e25..92dc351 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,8 +38,18 @@ RUN if [ ! -f .env ]; then \ echo .env; \ fi +# Intermediate stage to copy .env file if it exists +FROM base AS intermediate + +# Copy .env file into the Docker image COPY .env /app/ || true +# Final stage +FROM base + +# Copy files from the intermediate stage +COPY --from=intermediate /app/.env /app/ + COPY docker-entrypoint.sh /usr/local/bin/ RUN dos2unix /usr/local/bin/docker-entrypoint.sh RUN chmod +x /usr/local/bin/docker-entrypoint.sh