Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdias committed Mar 8, 2018
2 parents f029b9f + d7d9096 commit 864c00e
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 2 deletions.
5 changes: 3 additions & 2 deletions configureWorkspace/config-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export async function quickPickPlatform(): Promise<string>{
items.push('Go');
items.push('.NET Core');
items.push('Node.js');
items.push('Python');
items.push('Other');
return vscode.window.showQuickPick(items, opt);

return vscode.window.showQuickPick(items, opt);
}
58 changes: 58 additions & 0 deletions configureWorkspace/configure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,39 @@ WORKDIR /app
EXPOSE ${port}
COPY $source .
ENTRYPOINT dotnet ${serviceName}.dll
`;

case 'python':

return `
# Python support can be specified down to the minor or micro version
# (e.g. 3.6 or 3.6.3).
# OS Support also exists for jessie & stretch (slim and full).
# See https://hub.docker.com/r/library/python/ for all supported Python
# tags from Docker Hub.
FROM python:alpine
# If you prefer miniconda:
#FROM continuumio/miniconda3
LABEL Name=${serviceName} Version=${version}
EXPOSE ${port}
WORKDIR /app
ADD . /app
# Using pip:
RUN python3 -m pip install -r requirements.txt
CMD ["python3", "-m", "${serviceName}"]
# Using pipenv:
#RUN python3 -m pip install pipenv
#RUN pipenv install --ignore-pipfile
#CMD ["pipenv", "run", "python3", "-m", "${serviceName}"]
# Using miniconda (make sure to replace `myenv` w/ your environment name):
#RUN conda env create -f environment.yml
#CMD /bin/bash -c "source activate myenv && python3 -m ${serviceName}"
`;

default:
Expand Down Expand Up @@ -94,6 +127,17 @@ services:
ports:
- ${port}:${port}`;

case 'python':
return `version: '2.1'
services:
${serviceName}:
image: ${serviceName}
build: .
ports:
- ${port}:${port}`;


default:
return `version: '2.1'
Expand Down Expand Up @@ -143,6 +187,7 @@ services:
ports:
- ${port}:${port}
`;

case '.net core':
return `version: '2.1'
Expand All @@ -163,6 +208,19 @@ services:
entrypoint: tail -f /dev/null
`;

case 'python':
return `version: '2.1'
services:
${serviceName}:
image: ${serviceName}
build:
context: .
dockerfile: Dockerfile
ports:
- ${port}:${port}
`;

default:
return `version: '2.1'
Expand Down

0 comments on commit 864c00e

Please sign in to comment.