mirror of
https://github.com/marcel-dempers/docker-development-youtube-series.git
synced 2025-06-06 17:01:30 +00:00
python debugging examples
This commit is contained in:
parent
e66d185444
commit
e19376f909
16
.vscode/launch.json
vendored
16
.vscode/launch.json
vendored
@ -32,6 +32,20 @@
|
||||
"args": [],
|
||||
"trace" : "verbose",
|
||||
"env" : {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Python Attach",
|
||||
"type": "python",
|
||||
"request": "attach",
|
||||
"pathMappings": [
|
||||
{
|
||||
"localRoot": "${workspaceFolder}/python/src/",
|
||||
"remoteRoot": "/work"
|
||||
}
|
||||
],
|
||||
"port": 5678,
|
||||
"host": "127.0.0.1"
|
||||
},
|
||||
|
||||
]
|
||||
}
|
@ -44,7 +44,7 @@ services:
|
||||
image: aimvector/python:1.0.0
|
||||
build:
|
||||
context: ./python
|
||||
target: prod
|
||||
target: debug
|
||||
#working_dir: /work #comment out for build.target:prod
|
||||
#entrypoint: /bin/sh #comment out for build.target:prod
|
||||
#stdin_open: true #comment out for build.target:prod
|
||||
@ -53,3 +53,4 @@ services:
|
||||
- ./python/src/:/work
|
||||
ports:
|
||||
- 5003:5000
|
||||
- 5678:5678
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM python:3.7.3-alpine3.9 as dev
|
||||
FROM python:3.7.3-alpine3.9 as base
|
||||
|
||||
RUN mkdir /work/
|
||||
WORKDIR /work/
|
||||
@ -7,15 +7,16 @@ COPY ./src/requirements.txt /work/requirements.txt
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
COPY ./src/ /work/
|
||||
|
||||
###########START NEW IMAGE###################
|
||||
|
||||
FROM python:3.7.3-alpine3.9 as prod
|
||||
|
||||
RUN mkdir /app/
|
||||
WORKDIR /app/
|
||||
|
||||
COPY --from=dev /work/ /app/
|
||||
RUN pip install -r requirements.txt
|
||||
ENV FLASK_APP=server.py
|
||||
|
||||
###########START NEW IMAGE : DEBUGGER ###################
|
||||
FROM base as debug
|
||||
RUN pip install ptvsd
|
||||
|
||||
WORKDIR /work/
|
||||
CMD python -m ptvsd --host 0.0.0.0 --port 5678 --wait --multiprocess -m flask run -h 0.0.0 -p 5000
|
||||
|
||||
###########START NEW IMAGE: PRODUCTION ###################
|
||||
FROM base as prod
|
||||
|
||||
CMD flask run -h 0.0.0 -p 5000
|
||||
|
Loading…
x
Reference in New Issue
Block a user