mirror of
https://github.com/spliit-app/spliit.git
synced 2026-02-20 14:36:13 +01:00
Docker container version (#39)
* + Dockerfile and compose file + Scripts dir and startup script + Build image npm script * * Moves env to file * + Tags image with info from package.json * Moves image creation to script * Updates README * Update README.md Co-authored-by: Sebastien Castiel <sebastien@castiel.me> --------- Co-authored-by: Maxime Jacob <mjacob-no-reply@proton.me> Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
This commit is contained in:
8
scripts/build-image.sh
Executable file
8
scripts/build-image.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
SPLIIT_APP_NAME=$(node -p -e "require('./package.json').name")
|
||||
SPLIIT_VERSION=$(node -p -e "require('./package.json').version")
|
||||
|
||||
docker buildx build --no-cache -t ${SPLIIT_APP_NAME}:${SPLIIT_VERSION} -t ${SPLIIT_APP_NAME}:latest .
|
||||
|
||||
docker image prune -f
|
||||
5
scripts/image-startup.sh
Executable file
5
scripts/image-startup.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
prisma migrate deploy
|
||||
prisma generate
|
||||
npm run dev
|
||||
11
scripts/start-local-db.sh
Executable file
11
scripts/start-local-db.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
result=$(docker ps | grep postgres)
|
||||
if [ $? -eq 0 ];
|
||||
then
|
||||
echo "postgres is already running, doing nothing"
|
||||
else
|
||||
echo "postgres is not running, starting it"
|
||||
docker rm postgres --force
|
||||
mkdir -p postgres-data
|
||||
docker run --name postgres -d -p 5432:5432 -e POSTGRES_PASSWORD=1234 -v ./postgres-data:/var/lib/postgresql/data postgres
|
||||
sleep 5 # Wait for postgres to start
|
||||
fi
|
||||
Reference in New Issue
Block a user