From 51e9f04ceec5976e66a9afe08a4443f8e79eb1a1 Mon Sep 17 00:00:00 2001 From: Arthur Henrique Date: Sat, 6 Jan 2024 18:33:46 -0300 Subject: [PATCH] fix: docker build (#143) --- cookiecutter.json | 2 +- setup.py | 2 +- {{cookiecutter.project_slug}}/Dockerfile | 4 ++-- {{cookiecutter.project_slug}}/README.md | 6 ++++-- {{cookiecutter.project_slug}}/docker-compose.yml | 2 +- {{cookiecutter.project_slug}}/pyproject.toml | 4 ++-- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/cookiecutter.json b/cookiecutter.json index c09d872..f75293f 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -6,7 +6,7 @@ "machine_learn_model_name": "model.pkl", "input_example_path": "./ml/model/examples/example.json", "full_name": "Your name", - "email": "Your address email (you@example.com)", + "email": "you ", "release_date": "{% now 'local' %}", "version": "0.1.0", "_copy_without_render": [ diff --git a/setup.py b/setup.py index 822ffd8..3875537 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ "Framework :: FastAPI", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.11", "Topic :: Software Development", ], keywords=( diff --git a/{{cookiecutter.project_slug}}/Dockerfile b/{{cookiecutter.project_slug}}/Dockerfile index 91b6770..d950d21 100644 --- a/{{cookiecutter.project_slug}}/Dockerfile +++ b/{{cookiecutter.project_slug}}/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.12.0 +FROM python:3.11.0 ENV PYTHONUNBUFFERED 1 @@ -7,7 +7,7 @@ WORKDIR /app COPY poetry.lock pyproject.toml ./ RUN pip install --upgrade pip && \ pip install poetry && \ - poetry config virtualenvs.create false + poetry config virtualenvs.create false ARG DEV=false RUN if [ "$DEV" = "true" ] ; then poetry install --with dev ; else poetry install --only main ; fi diff --git a/{{cookiecutter.project_slug}}/README.md b/{{cookiecutter.project_slug}}/README.md index 4386e39..05ebf27 100644 --- a/{{cookiecutter.project_slug}}/README.md +++ b/{{cookiecutter.project_slug}}/README.md @@ -88,6 +88,7 @@ Application parts are: └── tests - pytest ## GCP + Deploying inference service to Cloud Run ### Authenticate @@ -112,6 +113,7 @@ Deploying inference service to Cloud Run 2. Delete Docker image in GCR ## AWS + Deploying inference service to AWS Lambda ### Authenticate @@ -123,9 +125,9 @@ Deploying inference service to AWS Lambda 1. Run `sam build` 2. Run `sam deploy --guiChange this portion for other types of models + ## Add the correct type hinting when completed `aws cloudformation delete-stack --stack-name ` - -Made by https://github.com/arthurhenrique/cookiecutter-fastapi/graphs/contributors with ❤️ +Made by with ❤️ diff --git a/{{cookiecutter.project_slug}}/docker-compose.yml b/{{cookiecutter.project_slug}}/docker-compose.yml index 38cf9c5..1b79df7 100644 --- a/{{cookiecutter.project_slug}}/docker-compose.yml +++ b/{{cookiecutter.project_slug}}/docker-compose.yml @@ -2,7 +2,7 @@ version: "3" services: app: - build: + build: context: . args: DEV: "true" diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml index 408ac4c..1452fa3 100644 --- a/{{cookiecutter.project_slug}}/pyproject.toml +++ b/{{cookiecutter.project_slug}}/pyproject.toml @@ -2,7 +2,7 @@ name = "{{cookiecutter.project_name}}" version = "0.1.0" description = "{{cookiecutter.project_short_description}}" -authors = ["{{cookiecutter.full_name}} ({{cookiecutter.email}})"] +authors = ["{{cookiecutter.full_name}} <{{cookiecutter.email}}>"] [tool.poetry.dependencies] python = "^3.9" @@ -44,4 +44,4 @@ exclude = ''' |Dockerfile |Jenkinfile )/ -''' \ No newline at end of file +'''