Modified/Created codes to enable python flask app in python container

docker-dev-guide_2
jason.zhu 2021-02-08 11:57:52 +11:00
parent ec9995d26c
commit 7f663d61fb
3 changed files with 18 additions and 2 deletions

View File

@ -37,10 +37,18 @@ services:
- ./nodejs/src/:/work
ports:
- 5502:5000
python:
python: #docker run -it -v ${PWD}:/work -w /work -p 5003:5000 aimvector/python:1.0.0 /bin/sh
container_name: python
image: cruxlight/python:1.0.0
build: ./python
working_dir: /work
entrypoint: /bin/sh
stdin_open: true
tty: true
volumes:
- ./python/src/:/work
ports:
- 5503:5000
first-public-dockerhub-image:
container_name: first-public-dockerhub-image
image: cruxlight/first-public-dockerhub-image:latest

View File

@ -1 +1,3 @@
FROM python:3.7.3-alpine3.9
FROM python:3.7.3-alpine3.9
RUN pip install flask

View File

@ -0,0 +1,6 @@
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"