Skip to content

Commit

Permalink
fix: revert envs (#272)
Browse files Browse the repository at this point in the history
- 好像不太对
  • Loading branch information
RaoHai authored Aug 30, 2024
2 parents 5cfca76 + bcb48cd commit 6875ee9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion docker/Dockerfile.aws.lambda
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ RUN pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}" -U --no-cach

# Set NLTK_DATA to load nltk_data
ENV NLTK_DATA=/opt/nltk_data
ENV ENV=production

CMD ["python", "main.py"]
1 change: 0 additions & 1 deletion docker/Dockerfile.subscriber
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ RUN pip install -r requirements.txt

# Copy function code
COPY . ${LAMBDA_TASK_ROOT}
ENV ENV=production
# Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile)
CMD [ "handler.lambda_handler" ]
8 changes: 2 additions & 6 deletions petercat_utils/utils/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
import os

def load_env():
env = os.getenv("ENV", "development")
print(f"load_env={env}")
load_dotenv(verbose=True, override=True)

if env == 'development':
load_dotenv(dotenv_path=".env.local", verbose=True, override=True)
load_dotenv(verbose=True, override=True)
load_dotenv(dotenv_path=".env.local", verbose=True, override=True)

load_env()

Expand Down

0 comments on commit 6875ee9

Please sign in to comment.