diff --git a/workers/Dockerfile.prod b/workers/Dockerfile.prod index d3de69eb..d4b6ce95 100644 --- a/workers/Dockerfile.prod +++ b/workers/Dockerfile.prod @@ -11,6 +11,9 @@ RUN mkdir worker WORKDIR /root/worker COPY . . +# Set environment variables for prod +ENV PROD=true + ENV PORT 8500 EXPOSE 8500 EXPOSE 65535 diff --git a/workers/pvinsight-validation-runner.py b/workers/pvinsight-validation-runner.py index 437534d3..a6274041 100644 --- a/workers/pvinsight-validation-runner.py +++ b/workers/pvinsight-validation-runner.py @@ -50,7 +50,7 @@ def is_local(): Returns: bool: True if the application is running locally, False otherwise. """ - return 'AWS_EXECUTION_ENV' not in os.environ and 'ECS_CONTAINER_METADATA_URI' not in os.environ and 'ECS_CONTAINER_METADATA_URI_V4' not in os.environ + return 'AWS_EXECUTION_ENV' not in os.environ and 'ECS_CONTAINER_METADATA_URI' not in os.environ and 'ECS_CONTAINER_METADATA_URI_V4' not in os.environ and 'PROD' not in os.environ is_s3_emulation = is_local() diff --git a/workers/submission_worker.py b/workers/submission_worker.py index fcbea7a8..276d253f 100644 --- a/workers/submission_worker.py +++ b/workers/submission_worker.py @@ -23,7 +23,7 @@ def is_local(): Returns: bool: True if the application is running locally, False otherwise. """ - return 'AWS_EXECUTION_ENV' not in os.environ and 'ECS_CONTAINER_METADATA_URI' not in os.environ and 'ECS_CONTAINER_METADATA_URI_V4' not in os.environ + return 'AWS_EXECUTION_ENV' not in os.environ and 'ECS_CONTAINER_METADATA_URI' not in os.environ and 'ECS_CONTAINER_METADATA_URI_V4' not in os.environ and 'PROD' not in os.environ is_s3_emulation = is_local()