Skip to content

Commit 90c8838

Browse files
author
Luiz Filipy
committed
🐍 Adicionado Python3 ao Docker 🐍
1 parent e1844d6 commit 90c8838

File tree

5 files changed

+48
-2
lines changed

5 files changed

+48
-2
lines changed

Python/Dockerfile

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM debian
2+
3+
RUN apt-get update -y && apt-get install -y python3-pip python3-dev
4+
5+
COPY ./requirements.txt /app/requirements.txt
6+
7+
WORKDIR /app
8+
9+
RUN pip3 install -r requirements.txt
10+
11+
COPY . /app
12+
13+
EXPOSE 3001
14+
15+
CMD [ "python3", "teste.py" ]

Python/hello.html

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<html lang="pt-BR">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
8+
<title>Hello {{ name }}!</title>
9+
</head>
10+
11+
<body>
12+
<h1>Hello {{ name }}!</h1>
13+
</body>
14+
15+
</html>

Python/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Flask==1.0.2

Python/teste.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import flask
2+
from flask import Flask, render_template
3+
4+
app = Flask(__name__, template_folder = '')
5+
6+
@app.route("/")
7+
def index():
8+
return "Flask App!"
9+
10+
@app.route("/hello/<string:name>/")
11+
def hello(name):
12+
return render_template('hello.html',name = name)
13+
14+
if __name__ == "__main__":
15+
app.run(host = '0.0.0.0', port = 3000)

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
</p>
44

55
# Criação e Execução da imagem
6-
#### GoLang
7-
> Para executar o teste execute os comandos abaixo
6+
#### GoLang, Python3
7+
> Para executar o teste execute os comandos abaixo dentro da pasta de determinada linguagem
88
99
1. Criar a imagem ```docker build -t luizfilipy/app .```
1010
2. Executar imagem ```docker run -p 3001:3000 -d luizfilipy/app```

0 commit comments

Comments
 (0)