forked from AFR2512/theFLASKAPP2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
J'ai eu des problèmes d'encryptage du code python qui ne m'ont pas permis de lancer l'application correctement et il semblerait que je sois à peu près le seul dans ces conditions (je ne sais pas d'où provient ce bug). J'ai donc dû modifié le dossier python localement pour tester mon code bien qu'il était écrit de ne pas le modifier. Les dockerfile et le docker-compose devraient tout de même fonctionner normalement dans un environnement où les fichiers pythons ne posent pas de problèmes (donc ceux déjà présent sur votre git account).
- Loading branch information
1 parent
1966b29
commit 56597b0
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
FROM python:3.8 | ||
|
||
WORKDIR /app | ||
|
||
COPY requirements.txt . | ||
|
||
RUN pip install -r requirements.txt | ||
|
||
COPY "app.py" . | ||
|
||
COPY "config.py" . | ||
|
||
COPY "model_saved" . | ||
|
||
ADD templates templates | ||
|
||
ADD tests tests | ||
|
||
ENV FLASK_APP=app.py | ||
|
||
RUN wget https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh -P /scripts | ||
|
||
RUN chmod +x /scripts/wait-for-it.sh | ||
|
||
ENTRYPOINT ["/scripts/wait-for-it.sh", "psql_db:5432", "--"] | ||
|
||
CMD ["python", "app.py", "runserver", "--host=0.0.0.0", "--threaded"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
version: "3.8" | ||
services: | ||
flaskapp: | ||
build: . | ||
image: titanic-flask:latest | ||
ports: | ||
- "5000:5000" | ||
links: | ||
- "postgres:psql_db" | ||
depends_on: | ||
- psql_db | ||
environment: | ||
SECRET_KEY: secret_key | ||
USE_POSTGRES: 'true' | ||
POSTGRES_PASSWORD: postgres_docker | ||
POSTGRES_USER: postgres_docker | ||
POSTGRES_DB: psql_db | ||
|
||
psql_db: | ||
image: postgres | ||
environment: | ||
POSTGRES_PASSWORD: postgres_docker | ||
POSTGRES_USER: postgres_docker | ||
restart: always |