forked from jhipster/generator-jhipster-svelte
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-release
69 lines (53 loc) · 1.84 KB
/
Dockerfile-release
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
FROM node:lts-alpine3.12
LABEL maintainer="Vishal Mahajan"
ARG SVELTE_PATH=/opt/svelte
ARG APP_PATH=/app
ARG NPM_PATH=/opt/npm-global
ARG GIT_USERNAME="JHipster Svelte Bot"
ARG GID=1000
ARG UID=1000
RUN apk update \
&& apk --no-cache --update add \
git \
openjdk11 \
ca-certificates \
wget \
bash
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \
&& wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.32-r0/glibc-2.32-r0.apk \
&& wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.32-r0/glibc-bin-2.32-r0.apk \
&& wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.32-r0/glibc-i18n-2.32-r0.apk \
&& apk add glibc-2.32-r0.apk glibc-bin-2.32-r0.apk glibc-i18n-2.32-r0.apk \
&& /usr/glibc-compat/bin/localedef -i en_US -f UTF-8 en_US.UTF-8 \
&& rm -rf glibc-2.32-r0.apk glibc-bin-2.32-r0.apk glibc-i18n-2.32-r0.apk \
&& apk del wget \
&& sed -i -e "s/bin\/ash/bin\/sh/" /etc/passwd
RUN \
echo ${GID} \
&& echo ${UID}
RUN \
deluser --remove-home node \
&& addgroup -S shipster -g ${GID} \
&& adduser -S -G shipster -u ${UID} shipster
RUN \
mkdir -p $APP_PATH \
&& mkdir -p $SVELTE_PATH \
&& mkdir -p $NPM_PATH \
&& chown -R shipster:shipster $APP_PATH \
&& chown -R shipster:shipster $SVELTE_PATH \
&& chown -R shipster:shipster $NPM_PATH
USER shipster
RUN \
npm config set prefix "$NPM_PATH" \
&& echo PATH="$NPM_PATH/bin:$PATH" >> "$HOME/.profile" \
&& . "$HOME/.profile"
RUN npm install -g --no-audit --quiet [email protected]
WORKDIR $APP_PATH
RUN \
git config --global user.email "$GIT_USER_EMAIL" \
&& git config --global user.name "$GIT_USERNAME"
ENV PATH "$NPM_PATH/bin:$PATH"
VOLUME ["$APP_PATH"]
EXPOSE 9000 8080
ENTRYPOINT ["shipster"]