Repository navigation
Expand file tree
/
Copy pathDockerfile.dev
More file actions
62 lines (50 loc) · 1.56 KB
/
Copy pathDockerfile.dev
File metadata and controls
62 lines (50 loc) · 1.56 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
FROM debian:13-slim
ARG PNPM_VERSION=10.34.9
ARG PRETTIER_VERSION=3.8.1
ARG RUFF_VERSION=0.16.6
ARG TY_VERSION=0.0.95
ENV DEBIAN_FRONTEND=noninteractive \
LANG=zh_CN.UTF-8 \
LC_ALL=zh_CN.UTF-8 \
PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/usr/bin/chromium \
TZ=Asia/Shanghai
RUN apt-get update \
&& apt-get install --no-install-recommends --yes \
ca-certificates \
chromium \
curl \
esbuild \
git \
locales \
make \
node-typescript \
nodejs \
npm \
openssh-client \
pipx \
procps \
python3 \
python3-jinja2 \
python3-requests \
tzdata \
&& localedef --inputfile=zh_CN --charmap=UTF-8 zh_CN.UTF-8 \
&& rm -rf /var/lib/apt/lists/*
RUN npm install --global \
"pnpm@${PNPM_VERSION}" \
"prettier@${PRETTIER_VERSION}" \
&& PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin \
pipx install "ruff==${RUFF_VERSION}" \
&& PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin \
pipx install "ty==${TY_VERSION}"
RUN groupadd --gid 1000 node \
&& useradd --uid 1000 --gid node --create-home --shell /bin/bash node
# Keep the store location stable when /workspace becomes a bind mount.
ENV npm_config_store_dir=/home/node/.local/share/pnpm/store
WORKDIR /workspace
COPY --chown=node:node package.json pnpm-lock.yaml ./
RUN su node -c 'pnpm install --frozen-lockfile --ignore-scripts'
COPY --chown=node:node . .
RUN install --directory --owner=node --group=node /srv/repo
USER node
EXPOSE 8000
CMD ["bash"]