add docker docker file for build application
This commit is contained in:
parent
855465fe8f
commit
560d7fbf0a
34
Dockerfile
Normal file
34
Dockerfile
Normal file
@ -0,0 +1,34 @@
|
||||
FROM python:3.12-alpine as base
|
||||
|
||||
ENV VENV_PATH=/app/.venv
|
||||
ENV PATH="$VENV_PATH/bin:$PATH"
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
|
||||
FROM base as builder
|
||||
|
||||
ENV POETRY_VIRTUALENVS_IN_PROJECT=1
|
||||
ENV POETRY_NO_INTERACTION=1
|
||||
ENV POETRY_VIRTUALENVS_CREATE=1
|
||||
|
||||
RUN pip install poetry
|
||||
|
||||
COPY pyproject.toml poetry.lock ./
|
||||
|
||||
RUN poetry install --no-root
|
||||
|
||||
|
||||
FROM base as runtime
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV PYTHONPATH=/app
|
||||
|
||||
|
||||
COPY --from=builder "$VENV_PATH" "$VENV_PATH"
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
COPY src ./src
|
||||
|
16
docker-compose.yml
Normal file
16
docker-compose.yml
Normal file
@ -0,0 +1,16 @@
|
||||
version: "3.9"
|
||||
services:
|
||||
dh-app:
|
||||
container_name: integration-dh-app
|
||||
build:
|
||||
target: runtime
|
||||
entrypoint: >
|
||||
uvicorn src.main:app
|
||||
--reload
|
||||
--port 80
|
||||
--host 0.0.0.0
|
||||
volumes:
|
||||
- "./src:/app/src"
|
||||
ports:
|
||||
- "31010:80"
|
||||
restart: unless-stopped
|
1528
poetry.lock
generated
Normal file
1528
poetry.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
19
pyproject.toml
Normal file
19
pyproject.toml
Normal file
@ -0,0 +1,19 @@
|
||||
[project]
|
||||
name = "donatehelperintegrate"
|
||||
version = "0.1.0"
|
||||
description = ""
|
||||
authors = [
|
||||
{name = "harold",email = "tihon414@gmail.com"}
|
||||
]
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.11"
|
||||
dependencies = [
|
||||
"fastapi[all] (>=0.116.1,<0.117.0)",
|
||||
"pydantic[email] (>=2.11.7,<3.0.0)",
|
||||
"httpx (>=0.28.1,<0.29.0)"
|
||||
]
|
||||
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core"]
|
||||
build-backend = "poetry.core.masonry.api"
|
Loading…
x
Reference in New Issue
Block a user