project refactor
This commit is contained in:
27
.devcontainer/Dockerfile
Normal file
27
.devcontainer/Dockerfile
Normal file
@ -0,0 +1,27 @@
|
||||
FROM python:3.12.2-bookworm
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive \
|
||||
DISPLAY=:99 \
|
||||
NICEGUI_STORAGE_PATH=data
|
||||
|
||||
# Install packages
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y \
|
||||
sudo git build-essential chromium chromium-driver python3-pip\
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create remote user
|
||||
ARG USERNAME=vscode
|
||||
ARG USER_UID=1000
|
||||
ARG USER_GID=$USER_UID
|
||||
|
||||
RUN groupadd --gid $USER_GID $USERNAME \
|
||||
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
|
||||
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
|
||||
&& chmod 0440 /etc/sudoers.d/$USERNAME
|
||||
|
||||
ENV PATH="/home/${USERNAME}/.local/bin:${PATH}"
|
||||
ENV CHROME_BINARY_LOCATION=/usr/bin/chromium
|
||||
|
||||
USER $USERNAME
|
||||
|
||||
CMD ["python", "wait.py"]
|
||||
38
.devcontainer/devcontainer.json
Normal file
38
.devcontainer/devcontainer.json
Normal file
@ -0,0 +1,38 @@
|
||||
// For format details, see https://aka.ms/devcontainer.json.
|
||||
{
|
||||
"name": "autopve-dev",
|
||||
"build": {
|
||||
"context": "..",
|
||||
"dockerfile": "Dockerfile"
|
||||
},
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"cschleiden.vscode-github-actions",
|
||||
"esbenp.prettier-vscode",
|
||||
"littlefoxteam.vscode-python-test-adapter",
|
||||
"ms-python.python",
|
||||
"samuelcolvin.jinjahtml",
|
||||
"Vue.volar"
|
||||
],
|
||||
"settings": {
|
||||
"python.testing.cwd": "/workspaces/autopve/",
|
||||
"python.testing.pytestArgs": ["tests"],
|
||||
"python.testing.unittestEnabled": false,
|
||||
"python.testing.pytestEnabled": true,
|
||||
"python.defaultInterpreterPath": "/usr/local/bin/python3",
|
||||
"terminal.integrated.defaultProfile.linux": "bash",
|
||||
"terminal.integrated.shell.linux": "bash",
|
||||
"terminal.integrated.profiles.linux": {
|
||||
"bash (container default)": {
|
||||
"path": "/usr/bin/bash",
|
||||
"overrideName": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// More info: https://aka.ms/dev-containers-non-root.
|
||||
"remoteUser": "vscode",
|
||||
"postCreateCommand": "/usr/local/bin/python3 -m pip install -r requirements-test.txt"
|
||||
}
|
||||
Reference in New Issue
Block a user