This commit is contained in:
Chuck Lantz 2019-04-01 19:16:54 -07:00
Родитель e441fb2bf4
Коммит 64bff0f97f
15 изменённых файлов: 37 добавлений и 23 удалений

Просмотреть файл

@ -62,16 +62,6 @@ The other definitions in the `containers` folder will provide examples of how to
You can easily share a customized dev container definition for your project by simply adding files like `.vscode/devContainer.json` to source control. By including these files in your repository, anyone that opens a local copy of your repo in VS Code will be automatically asked if they want reopen the folder in a container instead if the [Remote Development](https://aka.ms/vscode-remote/download/extension) extension installed.
You can also have VS Code prompt anyone opening your repo to install the Remote Development extension. Simply add the extension ID to `recommendations` array in `.vscode/extensions.json` (as described [here](https://code.visualstudio.com/docs/editor/extension-gallery#_workspace-recommended-extensions)) and then add the file to source control.
```json
{
"recommendations": [
"vscode.remote-development"
]
}
```
Beyond the advantages of having your team use a consistent environment and tool-chain, doing this can make it easier for new contributors or team members to get productive quickly. First-time contributors will require less guidance and are less likely to either submit issues or contribute code with issues that are related to environment setup.
## Contents

Просмотреть файл

@ -7,9 +7,14 @@ version: '3'
services:
# Update this to the name of the service you want to work with in your docker-compose.yml file
your-service-name-here:
# Uncomment if you want to add a different Dockerfile in the .devcontainer folder
# build:
# context: .
# dockerfile: Dockerfile
volumes:
# Update this to wherever you want VS Code to mount the folder of your project
- .:/workspace
- ..:/workspace
# Forwarding the socket is optional, but lets docker work inside the container if you install the Docker CLI.
# See the docker-in-docker-compose definition for details on how to install it.

Просмотреть файл

@ -8,9 +8,9 @@ services:
docker-in-docker:
build:
context: .
dockerfile: .devcontainer/Dockerfile
dockerfile: Dockerfile
volumes:
- .:/workspace
- ..:/workspace
# Forwarding the socket is the key to getting this to work
- /var/run/docker.sock:/var/run/docker.sock

Просмотреть файл

@ -8,9 +8,9 @@ services:
web:
build:
context: .
dockerfile: .devcontainer/Dockerfile
dockerfile: Dockerfile
volumes:
- .:/app
- ..:/app
ports:
- "3000:3000"
command: sleep infinity

Просмотреть файл

@ -6,7 +6,7 @@
FROM python:2-slim
# Copy endpoint specific user settings overrides into container to specify Python path
COPY settings.vscode.json /root/.vscode-remote/data/User/settings.json
COPY .devcontainer/settings.vscode.json /root/.vscode-remote/data/User/settings.json
RUN pip install pylint

Просмотреть файл

@ -5,6 +5,9 @@
FROM python:3-slim
# Copy default endpoint specific user settings overrides into container to specify Python path
COPY .devcontainer/settings.vscode.json /root/.vscode-remote/data/User/settings.json
ENV PYTHONUNBUFFERED 1
RUN pip install pylint

Просмотреть файл

@ -0,0 +1,4 @@
{
"python.linting.pylintEnabled": true,
"python.pythonPath": "/usr/local/bin/python"
}

Просмотреть файл

@ -5,10 +5,13 @@
FROM python:3-slim
# Copy default endpoint specific user settings overrides into container to specify Python path
COPY settings.vscode.json /root/.vscode-remote/data/User/settings.json
RUN mkdir /app
WORKDIR /app
COPY .devcontainer/requirements.txt /app/
COPY requirements.txt /app/
RUN pip install -r requirements.txt
RUN pip install pylint

Просмотреть файл

@ -12,7 +12,7 @@ services:
ports:
- "5000:5000"
volumes:
- .:/app
- ..:/app
command: sleep infinity
redis:
image: "redis:alpine"

Просмотреть файл

@ -0,0 +1,3 @@
{
"python.pythonPath": "/usr/local/bin/python"
}

Просмотреть файл

@ -1,3 +1,3 @@
{
"python.linting.pylintEnabled": true
"python.pythonPath": "/usr/local/bin/python"
}

Просмотреть файл

@ -10,10 +10,10 @@ USER root
RUN pip install pylint
# Copy jupyter_notebook_config.py with token that matches settings
COPY .devcontainer/jupyter_notebook_config.py /home/jovyan/.jupyter/jupyter_notebook_config.py
COPY jupyter_notebook_config.py /home/jovyan/.jupyter/jupyter_notebook_config.py
# Copy default endpoint specific user settings overrides into container to specify Python path, token
COPY .devcontainer/settings.vscode.json /home/jovyan/.vscode-remote/data/User/settings.json
COPY settings.vscode.json /home/jovyan/.vscode-remote/data/User/settings.json
# Install git
RUN apt-get update && apt-get -y install git

Просмотреть файл

@ -11,9 +11,9 @@ services:
jupyter:
build:
context: .
dockerfile: .devcontainer/Dockerfile
dockerfile: Dockerfile
ports:
- "8888:8888"
volumes:
- .:/notebook
- ..:/notebook

Просмотреть файл

@ -5,6 +5,9 @@
FROM python:3-slim
# Copy default endpoint specific user settings overrides into container to specify Python path
COPY .devcontainer/settings.vscode.json /root/.vscode-remote/data/User/settings.json
RUN pip install pylint
# Install git

Просмотреть файл

@ -0,0 +1,3 @@
{
"python.pythonPath": "/usr/local/bin/python"
}