Skip to content

Commit

Permalink
config docker
Browse files Browse the repository at this point in the history
  • Loading branch information
joseevilasio committed Sep 20, 2023
1 parent a67600c commit 99adbaa
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 2 deletions.
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM python:3.9

WORKDIR /app

COPY pyproject.toml poetry.lock README.md /app/
COPY api /app/api

RUN pip install --no-cache-dir poetry

RUN poetry install --no-dev

EXPOSE 5000

CMD ["poetry", "run", "gunicorn", "api.app:create_app()", "-b", "0.0.0.0:5000"]
18 changes: 18 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: '3.8'

services:
mongodb:
image: mongo
container_name: mongodb
ports:
- "27017:27017"

flask-app:
build:
context: .
dockerfile: Dockerfile
container_name: flask-app
ports:
- "5000:5000"
depends_on:
- mongodb
25 changes: 23 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ flask-pymongo = "^2.3.0"
flask-admin = "^1.6.1"
flask-simplelogin = "^0.1.2"
flask-jwt-extended = "^4.5.2"
gunicorn = "^21.2.0"


[tool.poetry.group.dev.dependencies]
Expand Down

0 comments on commit 99adbaa

Please sign in to comment.