docker env is working

This commit is contained in:
2024-06-18 15:03:29 +02:00
commit 7390c5d9be
26 changed files with 1155 additions and 0 deletions

39
Docker/app/Dockerfile Normal file
View File

@@ -0,0 +1,39 @@
FROM node:lts-bullseye
# THE ALL USER THINGS IS USELESS AS NODE IS ALREADY A USER @ 1000
# 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
# RUN if getent group ${USER_GNAME} ; then groupdel ${USER_GNAME}; fi
# RUN groupadd -g ${USER_GID} ${USER_GNAME}
# RUN useradd -l -u ${USER_UID} -g ${USER_GNAME} ${USER_UNAME}
# RUN install -d -m 0755 -o ${USER_UNAME} -g ${USER_GNAME} /home/${USER_UNAME}
# RUN chown --changes --silent --no-dereference --recursive \
# --from=33:33 ${USER_UID}:${USER_GID} \
# /home/${USER_UNAME}
# USER ${USER_UNAME}
# COPY ./bashrc /home/${USER_UNAME}/.bashrc
# COPY ./inputrc /home/${USER_UNAME}/.inputrc
# COPY ./bashrc /home/node/.bashrc # should do an echo in already existing /home/node/.bashcr
COPY ./inputrc /home/node/.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
Docker/app/bashrc Normal file
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'

View File

@@ -0,0 +1,30 @@
#!/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 "Npm init"
# npm ci
# echo "Run npm dev"
# npm run dev
echo "APP_ENV $APP_ENV"
if [ "$APP_ENV" = "prod" ]; then
echo "Run npm prod"
npm run build
else
echo "Run npm dev"
npm run dev
fi

2
Docker/app/inputrc Normal file
View File

@@ -0,0 +1,2 @@
set show-all-if-ambiguous on
set completion-ignore-case on