first docker env draft

This commit is contained in:
2020-05-27 12:44:24 +02:00
commit 13d886b152
10 changed files with 446 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
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 if getent group ${USER_GNAME} ; then groupdel ${USER_GNAME}; fi &&\
groupadd -g ${USER_GID} ${USER_GNAME} &&\
useradd -l -u ${USER_UID} -g ${USER_GNAME} ${USER_UNAME} &&\
install -d -m 0755 -o ${USER_UNAME} -g ${USER_GNAME} /home/${USER_UNAME} &&\
chown --changes --silent --no-dereference --recursive \
--from=33:33 ${USER_UID}:${USER_GID} \
/home/${USER_UNAME}
COPY ./bashrc /home/${USER_UNAME}/.bashrc
COPY ./inputrc /home/${USER_UNAME}/.inputrc
USER root
COPY ./client-entrypoint.sh /usr/local/bin
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'
+11
View File
@@ -0,0 +1,11 @@
#!/bin/sh
# cat /etc/passwd|grep 1000
echo "Npm install"
cd /app
npm install
echo "Run npm dev"
npm run dev
+2
View File
@@ -0,0 +1,2 @@
set show-all-if-ambiguous on
set completion-ignore-case on