docker ready for api (no app yet)

This commit is contained in:
2020-12-14 10:45:47 +01:00
parent 97df594616
commit f697afe63a
14 changed files with 120 additions and 65 deletions
+30
View File
@@ -0,0 +1,30 @@
FROM node:lts-alpine
RUN apk update && apk --no-cache add shadow && \
usermod -u 1001 node && \
groupmod -g 1001 node
RUN find / -group 1000 -exec chgrp -h node {} \;
RUN find / -user 1000 -exec chown -h node {} \;
ARG USER_UID
ARG USER_UNAME
ARG USER_GID
ARG USER_GNAME
# RUN addgroup -g 1000 gdp && \
# adduser -h /home/gdp -D -u 1000 gdp && \
RUN adduser -u ${USER_UID} -G users -s /bin/sh -D ${USER_UNAME}
# chown -R gdp:gdp /home/gdp
USER ${USER_UNAME}
COPY ./bashrc /home/${USER_UNAME}/.bashrc
COPY ./inputrc /home/${USER_UNAME}/.inputrc
COPY ./client-entrypoint.sh /usr/local/bin
USER root
RUN chmod +x /usr/local/bin/client-entrypoint.sh
USER ${USER_UNAME}
CMD ["/bin/sh","/usr/local/bin/client-entrypoint.sh"]
+3
View File
@@ -0,0 +1,3 @@
PS1='\e[36m\e[1mNODE\e[0m:\e[90m\w\e[0m\n$ '
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
+26
View File
@@ -0,0 +1,26 @@
#!/bin/sh
cat /etc/passwd|grep 1000
cd /app
echo "Cleaning node_modules"
rm -rf node_modules
echo "Cleaning npm cache"
npm cache clean --f
echo "Npm install"
npm install
# echo "Run npm dev"
# npm run dev
echo "APP_ENV $APP_ENV"
if [ "$APP_ENV" = "prod" ]; then
echo "Run npm prod"
npm run prod
else
echo "Run npm dev"
npm run dev
fi
+2
View File
@@ -0,0 +1,2 @@
set show-all-if-ambiguous on
set completion-ignore-case on