-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdev-frontend.Dockerfile
More file actions
82 lines (73 loc) · 1.77 KB
/
dev-frontend.Dockerfile
File metadata and controls
82 lines (73 loc) · 1.77 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Frontend Development Container
# Optimized for modern JavaScript/TypeScript development with all major frameworks
FROM node:18-slim as base
# Install system dependencies
RUN apt-get update && apt-get install -y \
# Build tools
python3 \
make \
g++ \
# Development utilities
git \
curl \
wget \
vim \
tree \
# Browser automation dependencies
libnss3-dev \
libatk-bridge2.0-dev \
libdrm2 \
libxcomposite1 \
libxdamage1 \
libxrandr2 \
libgbm1 \
libxss1 \
libasound2 \
# Cleanup
&& rm -rf /var/lib/apt/lists/*
# Install global development tools as root first
RUN npm install -g --force \
# Package managers
yarn \
pnpm \
# Build tools
vite \
webpack-cli \
parcel \
esbuild \
# Development tools
typescript \
ts-node \
nodemon \
# Code quality
eslint \
prettier \
# Testing
jest \
playwright \
cypress \
# Documentation
typedoc \
# Utilities
serve \
http-server \
concurrently
# Create development user
RUN groupadd -r devuser && useradd -r -g devuser devuser
RUN mkdir -p /home/devuser && chown devuser:devuser /home/devuser
# Set up development environment
ENV NODE_ENV=development
ENV NPM_CONFIG_PREFIX=/home/devuser/.npm-global
ENV PATH="/home/devuser/.npm-global/bin:${PATH}"
# Switch to development user
USER devuser
WORKDIR /workspace
# Install Playwright browsers (for testing) as devuser
RUN npx playwright install --with-deps chromium firefox webkit
# Expose common frontend development ports
EXPOSE 3000 3001 4000 4173 5173 8080 9000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD node --version
# Default command for development server
CMD ["npm", "run", "dev"]