Compare commits

..

4 Commits

4 changed files with 24 additions and 9 deletions

View File

@@ -16,16 +16,29 @@ 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
#Get the repos
RUN git clone https://git.shihaam.dev/shihaam/okiba-org-frontend \
&& git clone https://git.shihaam.dev/shihaam/okiba-org-backend \
#Install nginx, node and pnpm
RUN apt install nginx -y --no-install-recommends \
&& 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 \
&& nvm install node
# Clone repos
RUN git clone https://git.shihaam.dev/shihaam/okiba-org-frontend \
&& git clone https://git.shihaam.dev/shihaam/okiba-org-backend
# configure backend
RUN source ~/.profile && source ~/.bashrc \
&& 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
&& wget -O words.txt https://raw.githubusercontent.com/dwyl/english-words/master/words_alpha.txt
# configure frontend
COPY buildfiles/frontend-env /root/okiba-org-frontend/.env.local
RUN source ~/.profile && source ~/.bashrc \
&& cd /root/okiba-org-frontend ; pnpm install ; pnpm build ; cd - \
&& mv /root/okiba-org-frontend/dist/* /var/www/html/ \
&& rm -rfv /root/okiba-org-frontend/ /var/www/html/index.nginx-debian.html
# Copy Start Services
COPY buildfiles/start_services.sh .

View File

@@ -11,11 +11,11 @@ services:
image: git.shihaam.dev/dockerfiles/okiba
volumes:
- $PWD/backend-env:/root/okiba-org-backend/.env
- $PWD/frontend-env:/root/okiba-org-frontend/.env.local
- $PWD/logs/npm:/root/.npm/_logs/
- $PWD/logs/nginx:/var/log/nginx/
- $PWD/data/:/root/okiba-org-backend/data
ports:
- 3000:3000
- 3000:80
- 8080:8080
restart: always
#########################

1
buildfiles/frontend-env Normal file
View File

@@ -0,0 +1 @@
VITE_SERVER_URL=https://okiba.alk.pw

View File

@@ -1,8 +1,9 @@
#!/bin/bash
source $HOME/.profile; source $HOME/.bashrc
#Start frontend
cd /root/okiba-org-frontend; pnpm run dev --host &
/usr/sbin/nginx -g 'daemon off; master_process on;' &
#Start backend
cd /root/okiba-org-backend; pnpm start &