-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.node
33 lines (29 loc) · 1.07 KB
/
Dockerfile.node
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
ARG ALPINE_VERSION=3.20
FROM node:lts-alpine${ALPINE_VERSION}
LABEL maintainer="[email protected]"
## Install basic packages
RUN apk add --no-cache \
gcompat libstdc++ zip unzip jq sudo curl zsh
# Clear the ENTRYPOINT from node image
ENTRYPOINT []
# Set zsh as the default shell
RUN sed -i 's/\/root:\/bin\/ash/\/root:\/bin\/zsh/g' /etc/passwd
SHELL ["/bin/zsh", "-lc"]
ENV SHELL=/bin/zsh
CMD ["/bin/zsh", "--login"]
##
## Install PNPM
ENV PNPM_HOME=/root/.local/share/pnpm
ENV PATH=$PNPM_HOME:$PATH
RUN touch /etc/profile.d/pnpmPath.sh && \
echo "export PNPM_HOME=$PNPM_HOME" >> /etc/profile.d/pnpmPath.sh && \
echo "export PATH=$PNPM_HOME:$PATH" >> /etc/profile.d/pnpmPath.sh && \
source /etc/profile.d/pnpmPath.sh
# This will make the command re-run if theres a new pnpm version (prevents docker cache installing an older version)
ADD "https://api.github.com/repos/pnpm/pnpm/tags?per_page=1" latest_commit
RUN npx pnpm i -g pnpm@latest
RUN pnpm i -g @antfu/ni && \
touch ~/.nirc && \
echo 'defaultAgent=pnpm' >> ~/.nirc && \
echo 'globalAgent=pnpm' >> ~/.nirc
##