From 25988b82592de7c2bbf7126f5360b0ad6f38529b Mon Sep 17 00:00:00 2001 From: Shihaam Abdul Rahman Date: Fri, 20 Jan 2023 09:06:25 +0500 Subject: [PATCH] broken npm, does not work --- Dockerfile | 37 +++++++++++++++++++++++++++++++++++++ buildfiles/startservice.sh | 13 +++++++++++++ docker-compose.yml | 6 ++++++ 3 files changed, 56 insertions(+) create mode 100644 Dockerfile create mode 100644 buildfiles/startservice.sh create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d87287a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,37 @@ +FROM debian:11-slim + +# set work dir +WORKDIR /root/ +# Set build shell to bash, default has has some issues sometimes +SHELL ["/bin/bash", "-c"] +RUN apt update && apt upgrade -y + +# Language setup and Initial repo update +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en +ENV LC_ALL en_US.UTF-8 +RUN apt install git python-is-python3 ca-certificates lsb-release apt-transport-https wget curl nano vim locales -y \ + && apt auto-remove -y \ + && apt clean -y +RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen \ + && locale-gen + +#Install dependecies +RUN apt install graphicsmagick -y --no-install-recommends \ + && curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash \ + && source ~/.profile && source ~/.bashrc \ + && nvm install node + +# clone bibliogram +RUN git clone https://git.shihaam.dev/shihaam/bibliogram + +#NPM Install +RUN cd bibliogram \ + && source ~/.profile && source ~/.bashrc \ + && npm install + +COPY buildfiles/startservice.sh . +RUN chmod +x /root/startservice.sh + +# Start nginx +CMD /root/startservice.sh diff --git a/buildfiles/startservice.sh b/buildfiles/startservice.sh new file mode 100644 index 0000000..777f902 --- /dev/null +++ b/buildfiles/startservice.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +if ! [ -f /etc/nginx/nginx.conf ] +then cp -r /root/nginx/* /etc/nginx +fi + +#Start Nginx +/usr/sbin/nginx -g 'daemon off; master_process on;' & + +# Wait for any process to exit +wait -n +# Exit with status of process that exited first +exit $? diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..4c32711 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,6 @@ +version: '3.5' +services: +######################### + bibliogram: + build: . + image: git.shihaam.dev/dockerfiles/bibliogram