forked from Working-From-Home/ft_transcendence
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.42-node
39 lines (28 loc) · 1004 Bytes
/
Dockerfile.42-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
34
35
36
37
38
39
FROM node:16-alpine3.15
RUN apk add --no-cache su-exec curl zsh git emacs vim;
# https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#global-npm-dependencies
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
ENV PATH=$PATH:/home/node/.npm-global/bin
# set up specific uid and gid : https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#non-root-user
ARG HOST_UID=1000
ARG HOST_GID=1000
RUN deluser --remove-home node \
&& addgroup -S node -g $HOST_GID \
&& adduser -u $HOST_UID -G node -SD -s /bin/sh node \
&& mkdir -p /app \
&& chown -R node:node /app
USER node
ARG OH_MY_ZSH_THEME=cloud
RUN set -eux; \
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"; \
sed -i "s/\(^ZSH_THEME=\).*/\1$OH_MY_ZSH_THEME/" ~/.zshrc; \
npm install -g \
@nestjs/cli \
@vue/cli@next \
typeorm-cli;
VOLUME /app
WORKDIR /app
USER root
COPY docker-entrypoint.sh /usr/local/bin
ENTRYPOINT ["docker-entrypoint.sh"]
CMD [ "zsh" ]