Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
FROM ghcr.io/league-infrastructure/jtlpython:20240719
#FROM ghcr.io/league-infrastructure/jtlpython:20240719

FROM mcr.microsoft.com/devcontainers/python:3.12-bookworm
ENV VNC_RESOLUTION=600x600x16
ENV PASSWORD=code4life

COPY .devcontainer/install.sh /tmp/install-vnc.sh
# installs /usr/local/share/desktop-init.sh
RUN chmod 775 /tmp/install-vnc.sh
RUN /tmp/install-vnc.sh

RUN apt-get update && apt-get install -y --no-install-recommends \
x11-apps \
git \
imagemagick && \
rm -rf /var/lib/apt/lists/*

COPY requirements.txt /tmp/pip-tmp/
RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
&& rm -rf /tmp/pip-tmp

EXPOSE 6080
EXPOSE 5901
EXPOSE 8080

#RUN mkdir /workspace
#RUN git clone https://github.com/league-curriculum/Python-Apprentice /workspace


RUN curl -fsSL https://code-server.dev/install.sh | sh

USER vscode

CMD ["code-server", "--disable-workspace-trust", "--bind-addr", "0.0.0.0:8080", "/workspace"]
18 changes: 18 additions & 0 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@



docker run \
--sig-proxy=false \
-a STDOUT \
-a STDERR \
--mount type=bind,source=/Users/eric/proj/league-projects/curriculum/Python-Apprentice,target=/workspaces/Python-Apprentice,consistency=cached \
-l devcontainer.local_folder=/Users/eric/proj/league-projects/curriculum/Python-Apprentice \
-l devcontainer.config_file=/Users/eric/proj/league-projects/curriculum/Python-Apprentice/.devcontainer/devcontainer.json \
-e SDL_VIDEO_WINDOW_POS=0,0 \
-e SDL_AUDIODRIVER=dummy \
-p 8080:8080 \
-p 6080:6080 \
--init \
--entrypoint /bin/sh \
vsc-python-apprentice-c62618d2fa57d89881a493d3711298df25a53492283fc9697df93e45ef9b6a14 \
-c "echo Container started"
24 changes: 16 additions & 8 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,28 @@

// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/desktop-lite:1": {
"password" : "code4life"
}
//"ghcr.io/devcontainers/features/desktop-lite:1": {
// "password" : "code4life"
//}
},



// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [6080, 5901],
"forwardPorts": [8080, 6080],

"portsAttributes": {
"6080":{
"label": "VNC Web Screen"
},
"5901":{
"label":"VNC App"
}
},

"runArgs": [
"-p", "8080:8080", // Expose the code-server port
"-p", "6080:6080"
],
"overrideCommand": false , // Ensure CMD in Dockerfile is used


// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "./.devcontainer/setup.sh",
Expand All @@ -55,12 +58,17 @@
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.autopep8",
"ms-python.debugpy",
"ms-python.isort",
"ms-toolsai.jupyter"
],
"settings": {

"python.defaultInterpreterPath": "/usr/local/python/current/bin/python",
"[python]": {
"editor.defaultFormatter": "ms-python.autopep8"
}
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions .devcontainer/install-extensions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash


code --extensions-dir /app/extensions \
--install-extension "ms-python.python" \
--install-extension "ms-python.vscode-pylance" \
--install-extension "ms-python.autopep8" \
--install-extension "ms-python.debugpy" \
--install-extension "ms-python.isort" \
--install-extension "ms-toolsai.jupyter"
Loading
Loading