diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..6823a1d --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,24 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/python +{ + "name": "Python 3", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/python:1-3.10-bookworm", + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + "forwardPorts": [ + 8000,9080 + ], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "pip3 install --user -r requirements.txt", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index e0cc78f..0000000 --- a/.dockerignore +++ /dev/null @@ -1,27 +0,0 @@ -**/__pycache__ -**/.venv -**/.classpath -**/.dockerignore -**/.env -**/.git -**/.gitignore -**/.project -**/.settings -**/.toolstarget -**/.vs -**/.vscode -**/*.*proj.user -**/*.dbmdl -**/*.jfm -**/bin -**/charts -**/docker-compose* -**/compose* -**/Dockerfile* -**/node_modules -**/npm-debug.log -**/obj -**/secrets.dev.yaml -**/values.dev.yaml -LICENSE -README.md diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 94ff9c4..0000000 --- a/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -# For more information, please refer to https://aka.ms/vscode-docker-python -FROM python:3-slim - -EXPOSE 8090 - -# Keeps Python from generating .pyc files in the container -ENV PYTHONDONTWRITEBYTECODE=1 - -# Turns off buffering for easier container logging -ENV PYTHONUNBUFFERED=1 - -# Install pip requirements -COPY requirements.txt . -RUN python -m pip install -r requirements.txt - -WORKDIR /app -COPY . /app - -# Creates a non-root user with an explicit UID and adds permission to access the /app folder -# For more info, please refer to https://aka.ms/vscode-docker-python-configure-containers -RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app -USER appuser - -# During debugging, this entry point will be overridden. For more information, please refer to https://aka.ms/vscode-docker-python-debug -CMD ["gunicorn", "--bind", "0.0.0.0:8090", "-k", "uvicorn.workers.UvicornWorker", "app.main:app"] diff --git a/docker-compose.debug.yml b/docker-compose.debug.yml deleted file mode 100644 index 40bf1e7..0000000 --- a/docker-compose.debug.yml +++ /dev/null @@ -1,12 +0,0 @@ -version: '3.4' - -services: - fastapitest: - image: fastapitest - build: - context: . - dockerfile: ./Dockerfile - command: ["sh", "-c", "pip install debugpy -t /tmp && python /tmp/debugpy --wait-for-client --listen 0.0.0.0:5678 -m uvicorn app.main:app --host 0.0.0.0 --port 8090"] - ports: - - 8090:8090 - - 5678:5678 diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 0001f32..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,10 +0,0 @@ -version: '3.4' - -services: - fastapitest: - image: fastapitest - build: - context: . - dockerfile: ./Dockerfile - ports: - - 8090:8090 diff --git a/requirements.txt b/requirements.txt index 207fc17..7b56b75 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,2 @@ # To ensure app dependencies are ported from your virtual environment/host machine into your container, run 'pip freeze > requirements.txt' in the terminal to overwrite this file -fastapi[all]==0.109.0 -uvicorn[standard]==0.27.0 -gunicorn==21.2.0 +fastapi[standard] diff --git a/start.sh b/start.sh new file mode 100644 index 0000000..5943f1c --- /dev/null +++ b/start.sh @@ -0,0 +1 @@ +fastapi dev --port 9080 \ No newline at end of file