Skip to content

Commit

Permalink
more devcontainer changes
Browse files Browse the repository at this point in the history
  • Loading branch information
acockburn committed Feb 7, 2025
1 parent 0b70938 commit b299e39
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 26 deletions.
13 changes: 13 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
ARG PYTHON_RELEASE=3.13
ARG BASE_IMAGE=python:${PYTHON_RELEASE}


# Runtime image
FROM ${BASE_IMAGE}

ARG REMOTE_USER
ARG REMOTE_UID
ARG REMOTE_GID

RUN addgroup --gid ${REMOTE_GID} ${REMOTE_USER}
RUN adduser --disabled-password --uid ${REMOTE_UID} --gid ${REMOTE_GID} ${REMOTE_USER}

ENV HOME /home/${REMOTE_USER}

USER ${REMOTE_USER}

# Copy Repo across
COPY . /usr/src/appdaemon/

Expand Down
7 changes: 5 additions & 2 deletions .devcontainer/app_dir_testing/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerfile": "../Dockerfile",
"args": {
"PYTHON_RELEASE": "3.12" // This overrides the default of 3.13
"PYTHON_RELEASE": "3.12", // This overrides the default of 3.13
"REMOTE_USER": "${localEnv:USER}",
"REMOTE_UID": "${localEnv:REMOTE_UID:1000}",
"REMOTE_GID": "${localEnv:REMOTE_GID:1000}"
}
},

"remoteUser": "${localEnv:USER}",
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

Expand Down
12 changes: 6 additions & 6 deletions .devcontainer/python 3.10/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,19 @@
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerfile": "../Dockerfile",
"args": {
"PYTHON_RELEASE": "3.10" // This overrides the default of 3.13
"PYTHON_RELEASE": "3.10", // This overrides the default of 3.13
"REMOTE_USER": "${localEnv:USER}",
"REMOTE_UID": "${localEnv:REMOTE_UID:1000}",
"REMOTE_GID": "${localEnv:REMOTE_GID:1000}"
}
},

"remoteUser": "${localEnv:USER}",
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
//"forwardPorts": ["4949:4949"],
"appPort": [ "4949:4949" ],
"appPort": [ "5010:5010" ],
// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "cat /etc/os-release",

Expand All @@ -34,10 +37,7 @@
"extensions": [
"ms-python.python",
"njpwerner.autodocstring",
//"ms-python.black-formatter",
//"ms-python.isort",
"shd101wyy.markdown-preview-enhanced",
//"ms-python.pylint",
"DavidAnson.vscode-markdownlint",
"ms-python.debugpy",
"njqdev.vscode-python-typehint",
Expand Down
11 changes: 6 additions & 5 deletions .devcontainer/python 3.11/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerfile": "../Dockerfile",
"args": {
"PYTHON_RELEASE": "3.11" // This overrides the default of 3.13
"PYTHON_RELEASE": "3.11", // This overrides the default of 3.13
"REMOTE_USER": "${localEnv:USER}",
"REMOTE_UID": "${localEnv:REMOTE_UID:1000}",
"REMOTE_GID": "${localEnv:REMOTE_GID:1000}"
}
},
"remoteUser": "${localEnv:USER}",

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
//"forwardPorts": ["4949:4949"],
"appPort": [ "4949:4949" ],
"appPort": [ "5011:5011" ],
// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "cat /etc/os-release",

Expand All @@ -34,10 +38,7 @@
"extensions": [
"ms-python.python",
"njpwerner.autodocstring",
//"ms-python.black-formatter",
//"ms-python.isort",
"shd101wyy.markdown-preview-enhanced",
//"ms-python.pylint",
"DavidAnson.vscode-markdownlint",
"ms-python.debugpy",
"njqdev.vscode-python-typehint",
Expand Down
14 changes: 7 additions & 7 deletions .devcontainer/python 3.12/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
{
"name": "Pyhton 3.12",
"name": "Python 3.12",
"build": {
// Sets the run context to one level up instead of the .devcontainer folder.
"context": "../..",
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerfile": "../Dockerfile",
"args": {
"PYTHON_RELEASE": "3.12" // This overrides the default of 3.13
"PYTHON_RELEASE": "3.12", // This overrides the default of 3.13
"REMOTE_USER": "${localEnv:USER}",
"REMOTE_UID": "${localEnv:REMOTE_UID:1000}",
"REMOTE_GID": "${localEnv:REMOTE_GID:1000}"
}
},

"remoteUser": "${localEnv:USER}",
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
//"forwardPorts": ["4949:4949"],
"appPort": [ "4949:4949" ],
"appPort": [ "5012:5012" ],
// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "cat /etc/os-release",

Expand All @@ -34,10 +37,7 @@
"extensions": [
"ms-python.python",
"njpwerner.autodocstring",
//"ms-python.black-formatter",
//"ms-python.isort",
"shd101wyy.markdown-preview-enhanced",
//"ms-python.pylint",
"DavidAnson.vscode-markdownlint",
"ms-python.debugpy",
"njqdev.vscode-python-typehint",
Expand Down
11 changes: 6 additions & 5 deletions .devcontainer/python 3.13/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerfile": "../Dockerfile",
"args": {
"PYTHON_RELEASE": "3.13" // This overrides the default of 3.13
"PYTHON_RELEASE": "3.13", // This overrides the default of 3.13
"REMOTE_USER": "${localEnv:USER}",
"REMOTE_UID": "${localEnv:REMOTE_UID:1000}",
"REMOTE_GID": "${localEnv:REMOTE_GID:1000}"
}
},
"remoteUser": "${localEnv:USER}",

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
//"forwardPorts": ["4949:4949"],
"appPort": [ "4949:4949" ],
"appPort": [ "5013:5013" ],
// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "cat /etc/os-release",

Expand All @@ -34,10 +38,7 @@
"extensions": [
"ms-python.python",
"njpwerner.autodocstring",
//"ms-python.black-formatter",
//"ms-python.isort",
"shd101wyy.markdown-preview-enhanced",
//"ms-python.pylint",
"DavidAnson.vscode-markdownlint",
"ms-python.debugpy",
"njqdev.vscode-python-typehint",
Expand Down
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"label": "Run Dev",
"command": "${command:python.interpreterPath}",
"args": ["-m", "appdaemon", "-c", "/conf/ad_config/production", "--toml"],
"args": ["-m", "appdaemon", "-c", "/conf/ad_config/production"],
"type": "shell",
"presentation":
{
Expand Down

0 comments on commit b299e39

Please sign in to comment.