File tree Expand file tree Collapse file tree 3 files changed +26
-10
lines changed Expand file tree Collapse file tree 3 files changed +26
-10
lines changed Original file line number Diff line number Diff line change 3232 "args" : [],
3333 "trace" : " verbose" ,
3434 "env" : {}
35- }
35+ },
36+ {
37+ "name" : " Python Attach" ,
38+ "type" : " python" ,
39+ "request" : " attach" ,
40+ "pathMappings" : [
41+ {
42+ "localRoot" : " ${workspaceFolder}/python/src/" ,
43+ "remoteRoot" : " /work"
44+ }
45+ ],
46+ "port" : 5678 ,
47+ "host" : " 127.0.0.1"
48+ },
49+
3650 ]
3751}
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ services:
4444 image : aimvector/python:1.0.0
4545 build :
4646 context : ./python
47- target : prod
47+ target : debug
4848 # working_dir: /work #comment out for build.target:prod
4949 # entrypoint: /bin/sh #comment out for build.target:prod
5050 # stdin_open: true #comment out for build.target:prod
@@ -53,3 +53,4 @@ services:
5353 - ./python/src/:/work
5454 ports :
5555 - 5003:5000
56+ - 5678:5678
Original file line number Diff line number Diff line change 1- FROM python:3.7.3-alpine3.9 as dev
1+ FROM python:3.7.3-alpine3.9 as base
22
33RUN mkdir /work/
44WORKDIR /work/
@@ -7,15 +7,16 @@ COPY ./src/requirements.txt /work/requirements.txt
77RUN pip install -r requirements.txt
88
99COPY ./src/ /work/
10+ ENV FLASK_APP=server.py
1011
11- ###########START NEW IMAGE###################
12+ ###########START NEW IMAGE : DEBUGGER ###################
13+ FROM base as debug
14+ RUN pip install ptvsd
1215
13- FROM python:3.7.3-alpine3.9 as prod
16+ WORKDIR /work/
17+ CMD python -m ptvsd --host 0.0.0.0 --port 5678 --wait --multiprocess -m flask run -h 0.0.0 -p 5000
1418
15- RUN mkdir /app/
16- WORKDIR /app/
19+ ###########START NEW IMAGE: PRODUCTION ###################
20+ FROM base as prod
1721
18- COPY --from=dev /work/ /app/
19- RUN pip install -r requirements.txt
20- ENV FLASK_APP=server.py
2122CMD flask run -h 0.0.0 -p 5000
You can’t perform that action at this time.
0 commit comments