Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade development environment #117

Merged
merged 2 commits into from
Mar 12, 2022
Merged
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
27 changes: 27 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM python:3.10-bullseye

# Update the apt package index.
RUN apt-get update \
&& apt-get upgrade -y

# Install CLI utils.
RUN apt-get install -y zsh \
&& sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)" \
&& chsh -s $(which zsh) \
&& apt-get install -y git

# Instal NPM and Node.js.
RUN apt-get install -y npm \
&& npm install -g npm@latest \
&& apt-get install -y nodejs

# Install Home Assistant.
RUN apt-get install -y python3 \
python3-dev python3-venv python3-pip \
libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf \
build-essential libopenjp2-7 libtiff5 libturbojpeg0 tzdata \
&& python3 -m pip install wheel \
&& pip3 install homeassistant \
&& mkdir -p /config \
&& ln -sf "/workspaces/uptime-card/.devcontainer/configuration.yaml" /config/configuration.yaml \
&& ln -sf "/workspaces/uptime-card/.devcontainer/ui-lovelace.yaml" /config/ui-lovelace.yaml
14 changes: 6 additions & 8 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "Uptime Card Development",
"image": "ghcr.io/ludeeus/devcontainer/generic:stable",
"dockerFile": "./Dockerfile",
"context": "..",
"appPort": ["5000:5000", "8123:8123"],
"postCreateCommand": "npm install && container start",
"appPort": ["8000:8000", "5555:5555", "8123:8123"],
"postCreateCommand": "npm install",
"extensions": [
"aaron-bond.better-comments",
"bierner.lit-html",
Expand All @@ -14,21 +14,19 @@
"esbenp.prettier-vscode",
"github.copilot",
"github.vscode-pull-request-github",
"msjsdiag.debugger-for-chrome",
"redhat.vscode-yaml",
"runem.lit-plugin",
"yzhang.markdown-all-in-one"
],
"settings": {
"files.eol": "\n",
"editor.tabSize": 2,
"terminal.integrated.defaultProfile.linux": "bash",
"terminal.integrated.defaultProfile.linux": "zsh",
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"files.trimTrailingWhitespace": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"markdown.extension.toc.githubCompatibility": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
Expand All @@ -37,4 +35,4 @@
"**/.rpt2_cache/**": true
}
}
}
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,8 @@ Don't hesitate to ask for features or to contribute by yourself ⭐.
If you want to add a feature or fix a bug by yourself, follow these instructions:

1. Open the project inside a [devcontainer](https://code.visualstudio.com/docs/remote/containers).
2. Run the npm script `start`.
3. Open the browser and go to `http://localhost:8123/lovelace/0`.
2. Run `npm start`.
3. Open the browser and go to `http://localhost:8123/`.
4. Make changes and see the changes into the home assistant instance.

### Inspiration
Expand Down
Loading