webpty / Dockerfile
Ditzzy AF
feat: Update .gitignore and enhance terminal UI in Dockerfile and views/terminal.ejs
ca87d12
raw
history blame
1.16 kB
# Gunakan Node.js 22 berbasis Debian Bullseye
FROM node:22-bullseye
# Set working directory
WORKDIR /app
# Install dependencies sistem yang dibutuhkan untuk node-pty
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
make \
g++ \
bash \
curl \
git \
nano \
htop \
procps \
sudo \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy package files
COPY package*.json ./
# Install Node.js dependencies
RUN npm install --omit=dev && \
npm install node-pty || echo "node-pty installation failed, fallback enabled" && \
npm cache clean --force
# Copy seluruh aplikasi
COPY . .
# Buat folder views
RUN mkdir -p views
# Set permissions (optional karena root)
RUN chmod +x /app/app.js
# Expose port (Spaces biasanya override PORT lewat env)
EXPOSE 7860
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:${PORT:-7860}/login || exit 1
# Default shell untuk terminal sessions
ENV SHELL=/bin/bash
ENV HOME=/root
# Pastikan container berjalan sebagai root
USER root
# Start aplikasi
CMD ["node", "app.js"]