diff --git a/.dockerignore b/.dockerignore index 1f2644c..bc5483e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,8 +1,6 @@ __pycache__/ .git/ -.serverless/ .gitignore -serverless.yml *.env diff --git a/Dockerfile b/Dockerfile index fabb2a2..b64e7b1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,9 +2,25 @@ FROM python:3.13-alpine WORKDIR /app +RUN apk add --no-cache \ + nodejs \ + npm \ + bash + COPY requirements.txt /app/requirements.txt RUN pip install --no-cache-dir -r requirements.txt +# Copy Serverless config before installing plugins +COPY serverless.yml /app/serverless.yml + +# Install Serverless Framework globally +RUN npm install -g serverless + +# Install Serverless plugins +RUN serverless plugin install -n serverless-wsgi && \ + serverless plugin install -n serverless-ssm-fetch && \ + serverless plugin install -n serverless-python-requirements + COPY . /app EXPOSE 5000 diff --git a/docker-compose.yml b/docker-compose.yml index fbc6a17..8d03dec 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,4 +8,9 @@ services: - "${PORT}:${PORT}" environment: - API_KEY=${API_KEY} - - FLASK_DEBUG=1 \ No newline at end of file + - FLASK_DEBUG=1 + - AWS_REGION=${AWS_REGION} + - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} + - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} + - SERVERLESS_ACCESS_KEY=${SERVERLESS_ACCESS_KEY} + - PORT=${PORT} \ No newline at end of file diff --git a/env.example b/env.example new file mode 100644 index 0000000..2e85255 --- /dev/null +++ b/env.example @@ -0,0 +1,7 @@ +AWS_REGION=your-aws-region +AWS_ACCESS_KEY_ID=your-access-key +AWS_SECRET_ACCESS_KEY=your-secret-key +SERVERLESS_ACCESS_KEY=your-serverless-key +API_KEY=any-key +PORT=local-port-eg-5000 +FLASK_DEBUG=1 \ No newline at end of file