diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..cf1895aa --- /dev/null +++ b/.dockerignore @@ -0,0 +1,38 @@ +# Ignore node_modules and other dependencies +node_modules +.yarn +.yarnrc.yml + +# Ignore build directories +build +dist + +# Ignore logs and temporary files +logs +*.log +*.tmp + +# Ignore IDE and editor settings +.vscode +.idea + +# Ignore Git and GitHub files +.git +.github + +# Ignore Docker files +Dockerfile +.dockerignore + +# Ignore test and coverage files +coverage +test-results + +# Ignore OS-specific files +.DS_Store +Thumbs.db + +# Ignore other unnecessary files +*.md +*.yml +*.yaml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..251fed66 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +FROM ubuntu:latest +WORKDIR /app + +RUN apt-get update -y && \ + apt-get upgrade -y && \ + apt-get install -y golang-go nodejs npm && \ + npm install -g corepack && \ + corepack enable && \ + yarn install && \ + apt-get install -y libgtk2.0-0t64 libgtk-3-0t64 libgbm-dev libnotify-dev libnss3 libxss1 libasound2t64 libxtst6 xauth xvfb && \ + export DISPLAY=:0 && \ + service dbus start + +RUN git clone https://github.com/scripthaus-dev/scripthaus.git +WORKDIR /app/scripthaus + +RUN CGO_ENABLED=1 go build -o scripthaus cmd/main.go && \ + cp scripthaus /usr/local/bin + +WORKDIR /app +RUN mkdir waveterm + +WORKDIR /app/waveterm +COPY . . +RUN yarn cache clean +RUN yarn +RUN scripthaus run electron-rebuild +RUN scripthaus run build-backend +RUN scripthaus run webpack-watch + +RUN useradd -m -s /bin/bash wave +USER wave + +CMD [ "scripthaus", "run", "electron" ] + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..9f3711f1 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,15 @@ +version: '3.8' + +services: + wave: + build: + context: . + dockerfile: Dockerfile + container_name: waveterminal + environment: + - DISPLAY=${DISPLAY} + volumes: + - /tmp/.X11-unix:/tmp/.X11-unix + command: scripthaus run electron + stdin_open: true + tty: true \ No newline at end of file