chore: containerize project by adding Docker configuration files and ignore unnecessary files

This commit is contained in:
Sujal Goswami
2024-08-26 00:00:48 +05:30
parent 595102fefa
commit a5e6885597
3 changed files with 88 additions and 0 deletions
+38
View File
@@ -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
+35
View File
@@ -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" ]
+15
View File
@@ -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