Improve the devcontainer experience (#3492)
* Make it easier to run the devcontainer * Some more improvements * Tidy up few other things * Better name stages * Fix CI * Setup everything with one click * Allow to set IMAGE_OWNER * Change IMAGE_OWNER to IMAGE_REPO * Fix CI with IMAGE_REPO * Fix nodejs installation * Test devcontainer build as part of CI * Build devcontainer in its own job * Fix devcontainer cli installation * Fix devcontainer build * Fix devcontainer build in CI again * Enable buildkit only * Increase coverage of devcontainer test * Fix devcontainer start in CI * Ensure latest version of docker compose is used * Fix install compose action * Disable CI stuff which does not work until we fix thempull/4447/head
parent
253061ee5f
commit
65825040a3
11 changed files with 191 additions and 79 deletions
@ -0,0 +1,13 @@ |
||||
#!/bin/bash |
||||
|
||||
set -euo pipefail |
||||
|
||||
# These folders needs to be created and owned by the host user |
||||
mkdir -p debug web/dist |
||||
|
||||
if [[ -f "config/config.yml" ]]; then |
||||
echo "config/config.yml already exists, skipping initialization" >&2 |
||||
else |
||||
echo "initializing config/config.yml" >&2 |
||||
cp -fv config/config.yml.example config/config.yml |
||||
fi |
@ -0,0 +1,17 @@ |
||||
#!/bin/bash |
||||
|
||||
set -euxo pipefail |
||||
|
||||
# Frigate normal container runs as root, so it have permission to create |
||||
# the folders. But the devcontainer runs as the host user, so we need to |
||||
# create the folders and give the host user permission to write to them. |
||||
sudo mkdir -p /media/frigate |
||||
sudo chown -R "$(id -u):$(id -g)" /media/frigate |
||||
|
||||
make version |
||||
|
||||
cd web |
||||
|
||||
npm install |
||||
|
||||
npm run build |
@ -0,0 +1,16 @@ |
||||
mqtt: |
||||
host: mqtt |
||||
|
||||
cameras: |
||||
test: |
||||
ffmpeg: |
||||
inputs: |
||||
- path: /media/frigate/car-stopping.mp4 |
||||
input_args: -re -stream_loop -1 -fflags +genpts |
||||
roles: |
||||
- detect |
||||
- rtmp |
||||
detect: |
||||
height: 1080 |
||||
width: 1920 |
||||
fps: 5 |
@ -1,27 +0,0 @@ |
||||
FROM frigate:latest |
||||
|
||||
ARG USERNAME=vscode |
||||
ARG USER_UID=1000 |
||||
ARG USER_GID=$USER_UID |
||||
|
||||
# Create the user |
||||
RUN groupadd --gid $USER_GID $USERNAME \ |
||||
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME -s /bin/bash \ |
||||
# |
||||
# [Optional] Add sudo support. Omit if you don't need to install software after connecting. |
||||
&& apt-get update \ |
||||
&& apt-get install -y sudo \ |
||||
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ |
||||
&& chmod 0440 /etc/sudoers.d/$USERNAME |
||||
|
||||
RUN apt-get update \ |
||||
&& apt-get install -y git curl vim htop |
||||
|
||||
COPY requirements-dev.txt /opt/frigate/requirements-dev.txt |
||||
RUN pip3 install -r requirements-dev.txt |
||||
|
||||
# Install Node 16 |
||||
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - \ |
||||
&& apt-get install -y nodejs |
||||
|
||||
RUN npm install -g npm@latest |
Loading…
Reference in new issue