diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1cf083c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM python:3.11-slim + +WORKDIR /app + +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt gunicorn + +COPY . . + +EXPOSE 5000 + +CMD ["gunicorn", "-b", "0.0.0.0:5000", "app:app"] diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..35f580f --- /dev/null +++ b/compose.yml @@ -0,0 +1,18 @@ +services: + flask: + build: . + ports: + - "5001:5000" + environment: + DATABASE_URL: postgresql://postgres:postgres@db:5432/flaskdb + depends_on: + - db + + db: + image: postgres:16 + environment: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: flaskdb + ports: + - "5432:5432" diff --git a/requirements.txt b/requirements.txt index af34996..bad38d9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,7 @@ -Flask==1.1.2 -Werkzeug==1.0.1 -markupsafe==2.0.1 +blinker==1.9.0 +click==8.3.3 +Flask==3.1.3 +itsdangerous==2.2.0 +Jinja2==3.1.6 +MarkupSafe==3.0.3 +Werkzeug==3.1.8