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

Containerize project : configure dockerfile and compose files #767

Closed
wants to merge 7 commits into from
Closed
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
19 changes: 19 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "Wave Terminal Dev Container",
"dockerComposeFile": "../docker-compose.yml",
"service": "wave",
"workspaceFolder": "/app/waveterm",
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"extensions": [
"golang.go",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
}
},
"remoteUser": "wave"
}
21 changes: 21 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Ignore node_modules and other dependencies
node_modules
.yarn

# Ignore build directories
build
dist

# Ignore logs and temporary files
logs
*.log
*.tmp

# Ignore test and coverage files
coverage
test-results

# Ignore OS-specific files
.DS_Store
Thumbs.db

33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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

18 changes: 18 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: '3.8'

services:
wave:
build:
context: .
dockerfile: Dockerfile
container_name: waveterminal
environment:
- DISPLAY=${DISPLAY}
- NODE_ENV=development
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix
- .:/app/waveterm
stdin_open: true
tty: true
ports:
- "3000:3000"