Skip to content

Commit 7a82181

Browse files
committed
adding devcontainer
1 parent 9ab1b87 commit 7a82181

2 files changed

Lines changed: 85 additions & 0 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.163.1/containers/python-3/.devcontainer/base.Dockerfile
2+
3+
# [Choice] Python version: 3, 3.9, 3.8, 3.7, 3.6
4+
ARG VARIANT="3"
5+
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
6+
7+
# [Option] Install Node.js
8+
ARG INSTALL_NODE="false"
9+
ARG NODE_VERSION="lts/*"
10+
11+
# Geosupport release versions, change args in devcontainer.json to build against a new version
12+
ARG RELEASE=21a
13+
ARG MAJOR=21
14+
ARG MINOR=1
15+
ARG PATCH=0
16+
17+
RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
18+
19+
WORKDIR /geosupport
20+
COPY . .
21+
22+
RUN FILE_NAME=linux_geo${RELEASE}_${MAJOR}_${MINOR}.zip\
23+
&& echo $FILE_NAME\
24+
&& curl -O https://www1.nyc.gov/assets/planning/download/zip/data-maps/open-data/$FILE_NAME\
25+
&& unzip *.zip\
26+
&& rm *.zip
27+
28+
ENV GEOFILES=/geosupport/version-${RELEASE}_${MAJOR}.${MINOR}/fls/
29+
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/geosupport/version-${RELEASE}_${MAJOR}.${MINOR}/lib/
30+
31+
WORKDIR /

.devcontainer/devcontainer.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.163.1/containers/python-3
3+
{
4+
"name": "Python 3",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
"context": "..",
8+
"args": {
9+
// Update 'VARIANT' to pick a Python version: 3, 3.6, 3.7, 3.8, 3.9
10+
"VARIANT": "3.8",
11+
// Options
12+
"INSTALL_NODE": "false",
13+
"NODE_VERSION": "lts/*",
14+
"RELEASE": "21a",
15+
"MAJOR": "21",
16+
"MINOR": "1",
17+
"PATCH": "0",
18+
}
19+
},
20+
21+
// Set *default* container specific settings.json values on container create.
22+
"settings": {
23+
"terminal.integrated.shell.linux": "/bin/bash",
24+
"python.pythonPath": "/usr/local/bin/python",
25+
"python.linting.enabled": true,
26+
"python.linting.pylintEnabled": true,
27+
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
28+
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
29+
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
30+
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
31+
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
32+
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
33+
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
34+
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
35+
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint"
36+
},
37+
38+
// Add the IDs of extensions you want installed when the container is created.
39+
"extensions": [
40+
"ms-python.python"
41+
],
42+
43+
// Adding id_rsa so that we can push to github from the dev container
44+
"initializeCommand": "ssh-add $HOME/.ssh/id_rsa",
45+
46+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
47+
// "forwardPorts": [],
48+
49+
// Use 'postCreateCommand' to run commands after the container is created.
50+
"postCreateCommand": "pip3 install -e .",
51+
52+
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
53+
"remoteUser": "vscode"
54+
}

0 commit comments

Comments
 (0)