-
-
Notifications
You must be signed in to change notification settings - Fork 162
Expand file tree
/
Copy pathDockerfile.dev
More file actions
43 lines (33 loc) · 1.02 KB
/
Dockerfile.dev
File metadata and controls
43 lines (33 loc) · 1.02 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
# Use a more recent Debian-based Node.js image for better development support
FROM node:22-bullseye
# Install development tools and dependencies
RUN apt-get update && apt-get install -y \
git \
python3 \
build-essential \
procps \
vim \
tzdata \
&& rm -rf /var/lib/apt/lists/*
# Add proper timezone
ARG TZ=Europe/Berlin
RUN ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime && \
echo "${TZ}" > /etc/timezone
# Create non-root user for better security
RUN useradd -ms /bin/bash vscode
RUN mkdir -p /home/vscode/workspace
WORKDIR /home/vscode/workspace
# Install global development tools
RUN npm install -g node-gyp@latest
# Copy package files
COPY package*.json ./
# Install dependencies with legacy peer deps to handle older packages
RUN npm install --legacy-peer-deps
# Give vscode user ownership of the workspace
RUN chown -R vscode:vscode /home/vscode
# Switch to non-root user
USER vscode
# Expose the default port
EXPOSE 3000
# Default command to keep container running
CMD ["sleep", "infinity"]