From a27acf1ad349b7ac1604277bf55dd1a0bb1d5df1 Mon Sep 17 00:00:00 2001 From: Shiham Abdul Rahman Date: Tue, 13 Dec 2022 23:46:50 +0500 Subject: [PATCH] probably working build --- Dockerfile | 19 ++++++++----------- buildfiles/start_services.sh | 13 +++---------- docker-compose.yml | 4 ++-- 3 files changed, 13 insertions(+), 23 deletions(-) diff --git a/Dockerfile b/Dockerfile index 56da139..a3d2775 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,19 +16,16 @@ RUN apt install git ca-certificates lsb-release apt-transport-https wget curl na RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen \ && locale-gen -# Installing basic tools -RUN apt install nodejs npm -y --no-install-recommends \ - && apt auto-remove -y \ - && apt clean -y - #Get the repos RUN git clone https://git.shihaam.dev/shihaam/okiba-org-frontend \ - && git clone https://git.shihaam.dev/shihaam/okiba-org-backend - -RUN cd /root/okiba-org-frontend \ - && npm install \ - && cd /root/okiba-org-backend \ - && apt purge npm + && git clone https://git.shihaam.dev/shihaam/okiba-org-backend \ + && curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash \ + && curl -fsSL https://get.pnpm.io/install.sh | bash \ + && source ~/.profile && source ~/.bashrc \ + && nvm install node \ + && cd /root/okiba-org-backend ; pnpm build \ + && wget -O words.txt https://raw.githubusercontent.com/dwyl/english-words/master/words_alpha.txt \ + && cd /root/okiba-org-frontend ; pnpm install ; pnpm run build # Copy Start Services COPY buildfiles/start_services.sh . diff --git a/buildfiles/start_services.sh b/buildfiles/start_services.sh index f475daa..671362e 100644 --- a/buildfiles/start_services.sh +++ b/buildfiles/start_services.sh @@ -1,17 +1,10 @@ #!/bin/bash -#Default auto configs -if ! [ -f init/init ] -then ./auto_config.sh -fi - -#Start Php-fpm -cd && node & +#Start backend +cd /root/okiba-org-frontend; pnpm start & #Start frontend -cd && node & - - +cd /root/okiba-org-backend; pnpm run dev & # Wait for any process to exit wait -n diff --git a/docker-compose.yml b/docker-compose.yml index 3f7cbb0..cdb1ee8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,8 +4,8 @@ services: build: . hostname: okiba-org image: git.shihaam.dev/dockerfiles/okiba-org-docker -# volumes: -# - $PWD/ + volumes: + - $PWD/logs/npm:/root/.npm/_logs/ # ports: # - 1111:80 restart: always