Compare commits
2 commits
7993222715
...
9155206b5c
Author | SHA1 | Date | |
---|---|---|---|
9155206b5c | |||
95614a9208 |
5 changed files with 46 additions and 1 deletions
11
Dockerfile
Normal file
11
Dockerfile
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
FROM python:3.11-slim
|
||||||
|
WORKDIR /paste
|
||||||
|
COPY requirements.txt requirements.txt
|
||||||
|
COPY paste ${WORKDIR}
|
||||||
|
|
||||||
|
RUN apt update && apt install -y wget && apt -y clean
|
||||||
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
|
EXPOSE 5000
|
||||||
|
|
||||||
|
CMD [ "python3", "-m" , "flask", "run", "--host=0.0.0.0"]
|
13
docker-compose-dev.yml
Normal file
13
docker-compose-dev.yml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
services:
|
||||||
|
paste:
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- "5000:5000"
|
||||||
|
environment:
|
||||||
|
PASTE_REDIS_HOST: "redis"
|
||||||
|
healthcheck:
|
||||||
|
test: [ 'CMD', 'wget', '-q', '--spider', 'http://localhost/health']
|
||||||
|
redis:
|
||||||
|
image: "redis:7.0"
|
||||||
|
healthcheck:
|
||||||
|
test: [ 'CMD', 'redis-cli', 'ping' ]
|
13
docker-compose.yml
Normal file
13
docker-compose.yml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
services:
|
||||||
|
paste:
|
||||||
|
build: git.gnous.eu/gnouseu/paste
|
||||||
|
ports:
|
||||||
|
- "5000:5000"
|
||||||
|
environment:
|
||||||
|
PASTE_REDIS_HOST: "redis"
|
||||||
|
healthcheck:
|
||||||
|
test: [ 'CMD', 'wget', '-q', '--spider', 'http://localhost/health']
|
||||||
|
redis:
|
||||||
|
image: "redis:7.0"
|
||||||
|
healthcheck:
|
||||||
|
test: [ 'CMD', 'redis-cli', 'ping' ]
|
|
@ -87,3 +87,12 @@ def get_content(path: str) -> str:
|
||||||
return render_template("content.html.j2")
|
return render_template("content.html.j2")
|
||||||
|
|
||||||
return abort(404)
|
return abort(404)
|
||||||
|
|
||||||
|
|
||||||
|
@home.route("/check")
|
||||||
|
def health_check() -> str:
|
||||||
|
"""
|
||||||
|
For verify if the app run.
|
||||||
|
:return: "ok".
|
||||||
|
"""
|
||||||
|
return "ok"
|
||||||
|
|
|
@ -59,7 +59,6 @@ exclude = [
|
||||||
"instances",
|
"instances",
|
||||||
"schema.sql"
|
"schema.sql"
|
||||||
]
|
]
|
||||||
format = "grouped"
|
|
||||||
|
|
||||||
[tool.isort]
|
[tool.isort]
|
||||||
profile = "black"
|
profile = "black"
|
||||||
|
|
Reference in a new issue