Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (39 loc) · 1.52 KB
/
Copy pathDockerfile
File metadata and controls
51 lines (39 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Use node:22-alpine as a parent image for smallest size and best security
FROM node:22-alpine
# Alpine uses ash shell by default, which is sufficient for our needs
# No need to install bash unless specifically required
# Set the working directory in the container
WORKDIR /usr/src/app
# Copy package.json and package-lock.json (if available)
COPY package*.json index.js ./
# Install production dependencies
# RUN npm install --production
RUN npm i --audit=false --bin-links=false --fund=false --production
COPY app/ ./app/
# Environment-first approach: No config.json needed
# All configuration via environment variables
# Uncomment the next line if you want to include a config.json template
# COPY config.json.sample config.json
# Set default environment variables
ENV WEBSSH2_LISTEN_IP=0.0.0.0
ENV WEBSSH2_LISTEN_PORT=2222
ENV WEBSSH2_SSH_PORT=22
ENV WEBSSH2_SSH_TERM=xterm-256color
ENV WEBSSH2_SSH_ALGORITHMS_PRESET=modern
ENV WEBSSH2_HEADER_BACKGROUND=green
ENV WEBSSH2_SESSION_NAME=webssh2.sid
ENV WEBSSH2_OPTIONS_CHALLENGE_BUTTON=true
ENV WEBSSH2_OPTIONS_ALLOW_REAUTH=true
ENV WEBSSH2_OPTIONS_ALLOW_RECONNECT=true
ENV WEBSSH2_OPTIONS_ALLOW_REPLAY=true
ENV WEBSSH2_OPTIONS_AUTO_LOG=false
# HTTP CORS - default to restrictive (override in deployment)
ENV WEBSSH2_HTTP_ORIGINS="*:*"
# Legacy PORT support (maps to WEBSSH2_LISTEN_PORT)
ENV PORT=2222
# Debug configuration (empty by default)
ENV DEBUG=
# Make port 2222 available to the world outside this container
EXPOSE 2222
# Run the app when the container launches
CMD ["npm", "start"]