Skip to content

Commit

Permalink
add start script, use npm ci
Browse files Browse the repository at this point in the history
  • Loading branch information
akmatoff committed Oct 12, 2024
1 parent 9a998cb commit 5e3ad2d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ jobs:
port: 22
script: |
cd backoffice;
git pull;
docker stop backoffice;
docker rm backoffice;
docker pull akmatoff/backoffice:latest;
docker run --restart always -d -p 4000:4000 --name backoffice akmatoff/backoffice:latest
docker run --restart always -d -p 4000:4000 --name backoffice akmatoff/backoffice:latest
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ENV VITE_BASE_URL=${VITE_BASE_URL}

COPY package*.json /

RUN npm install
RUN npm ci

COPY . .

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite --port 4000",
"dev": "vite --port 4000 --host 0.0.0.0",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview --port 4000 --host 0.0.0.0"
Expand Down Expand Up @@ -68,4 +68,4 @@
"vite": "^5.0.8",
"vite-tsconfig-paths": "^4.3.1"
}
}
}
12 changes: 12 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

if [ -f .env.local ]; then
export $(grep -v '^#' .env.local | xargs)
else
echo ".env.local file not found!"
exit 1
fi

docker build --build-arg VITE_BASE_URL=$VITE_BASE_URL --target=dev -t backoffice .

docker run --env-file .env.local -p 4000:4000 backoffice

0 comments on commit 5e3ad2d

Please sign in to comment.