```
add Docker Compose configuration files for CMS, Doc, Ionic Mobile, API_TS, and PocketBase services, along with .env file for environment variables and related scripts ```
This commit is contained in:
14
002_source/docker/.env
Normal file
14
002_source/docker/.env
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# THIS IS env file for use with docker-compose.yml
|
||||||
|
|
||||||
|
# cms
|
||||||
|
|
||||||
|
# doc
|
||||||
|
|
||||||
|
# ionic_mobile
|
||||||
|
|
||||||
|
# api_ts
|
||||||
|
|
||||||
|
# pocketbase
|
||||||
|
PB_HOSTNAME=pocketbase
|
||||||
|
PB_USERNAME=admin@123.com
|
||||||
|
PB_PASSWORD=Aa12345678
|
35
002_source/docker/docker-compose.db.yml
Normal file
35
002_source/docker/docker-compose.db.yml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
volumes:
|
||||||
|
shared:
|
||||||
|
dist:
|
||||||
|
|
||||||
|
services:
|
||||||
|
pocketbase:
|
||||||
|
# image: ghcr.io/muchobien/pocketbase:latest
|
||||||
|
build:
|
||||||
|
context: ./pocketbase/docker
|
||||||
|
args:
|
||||||
|
- VERSION=0.26.6 # Specify the PocketBase version here
|
||||||
|
# hostname: pocketbase
|
||||||
|
restart: always
|
||||||
|
# environment:
|
||||||
|
# ENCRYPTION: example #optional
|
||||||
|
ports:
|
||||||
|
- 8090:8090
|
||||||
|
volumes:
|
||||||
|
- ./volumes/pocketbase/pb_data:/pb_data
|
||||||
|
#
|
||||||
|
- ../pocketbase/pb_migrations:/pb_migrations
|
||||||
|
- ../pocketbase/pb_hooks:/pb_hooks
|
||||||
|
# healthcheck:
|
||||||
|
# #optional (recommended) since v0.10.0
|
||||||
|
# test: wget --no-verbose --tries=1 --spider http://localhost:8090/api/health || exit 1
|
||||||
|
# interval: 5s
|
||||||
|
# timeout: 5s
|
||||||
|
# retries: 5
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpus: 0.5
|
||||||
|
reservations:
|
||||||
|
cpus: 0.01
|
@@ -6,7 +6,7 @@ services:
|
|||||||
deploy:
|
deploy:
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpus: "1"
|
cpus: '1'
|
||||||
|
|
||||||
doc:
|
doc:
|
||||||
environment:
|
environment:
|
||||||
@@ -14,7 +14,7 @@ services:
|
|||||||
deploy:
|
deploy:
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpus: "1"
|
cpus: '1'
|
||||||
|
|
||||||
ionic_mobile:
|
ionic_mobile:
|
||||||
environment:
|
environment:
|
||||||
@@ -22,7 +22,7 @@ services:
|
|||||||
deploy:
|
deploy:
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpus: "1"
|
cpus: '1'
|
||||||
|
|
||||||
api_ts:
|
api_ts:
|
||||||
environment:
|
environment:
|
||||||
@@ -30,4 +30,4 @@ services:
|
|||||||
deploy:
|
deploy:
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpus: "1"
|
cpus: '1'
|
120
002_source/docker/docker-compose.yml
Normal file
120
002_source/docker/docker-compose.yml
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
volumes:
|
||||||
|
shared:
|
||||||
|
dist:
|
||||||
|
|
||||||
|
services:
|
||||||
|
cms:
|
||||||
|
image: 192.168.10.61:5000/cms_ubuntu
|
||||||
|
# build: ./cms
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
volumes:
|
||||||
|
- ./cms:/app
|
||||||
|
ports:
|
||||||
|
- 3000:3000
|
||||||
|
working_dir: /app
|
||||||
|
command: ./scripts/docker/entrypoint.sh
|
||||||
|
depends_on:
|
||||||
|
pocketbase:
|
||||||
|
condition: service_healthy
|
||||||
|
healthcheck:
|
||||||
|
#optional (recommended) since v0.10.0
|
||||||
|
test: wget --no-verbose --tries=1 --spider http://localhost:3000 || exit 1
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
deploy:
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpus: '0.5'
|
||||||
|
reservations:
|
||||||
|
cpus: '0.01'
|
||||||
|
|
||||||
|
doc:
|
||||||
|
build: ./doc
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
volumes:
|
||||||
|
- ./doc:/app
|
||||||
|
ports:
|
||||||
|
- 3001:3000
|
||||||
|
working_dir: /app
|
||||||
|
command: ./scripts/docker/entrypoint.sh
|
||||||
|
healthcheck:
|
||||||
|
#optional (recommended) since v0.10.0
|
||||||
|
test: wget --no-verbose --tries=1 --spider http://localhost:3000 || exit 1
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpus: '0.5'
|
||||||
|
reservations:
|
||||||
|
cpus: '0.01'
|
||||||
|
|
||||||
|
ionic_mobile:
|
||||||
|
# image: node:20-bullseye-slim
|
||||||
|
# build: ./ionic_mobile
|
||||||
|
image: 192.168.10.61:5000/ionic_mobile_ubuntu
|
||||||
|
# user: 1000:1000
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
volumes:
|
||||||
|
- ./ionic_mobile:/app
|
||||||
|
ports:
|
||||||
|
- 5173:5173
|
||||||
|
working_dir: /app
|
||||||
|
command: ./scripts/docker/entrypoint.sh
|
||||||
|
depends_on:
|
||||||
|
pocketbase:
|
||||||
|
condition: service_healthy
|
||||||
|
healthcheck:
|
||||||
|
#optional (recommended) since v0.10.0
|
||||||
|
test: wget --no-verbose --tries=1 --spider http://localhost:5173 || exit 1
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpus: '0.5'
|
||||||
|
reservations:
|
||||||
|
cpus: '0.01'
|
||||||
|
|
||||||
|
api_ts:
|
||||||
|
# TODO: review this config, the api_ts volumes should be place inside 002_source/docker/volumes
|
||||||
|
image: 192.168.10.61:5000/api_ts_ubuntu
|
||||||
|
# build: ./api_ts
|
||||||
|
volumes:
|
||||||
|
- ../api_ts:/app
|
||||||
|
working_dir: /app
|
||||||
|
# env_file:
|
||||||
|
# - .env
|
||||||
|
environment:
|
||||||
|
- NODE_ENV=production
|
||||||
|
- PB_HOSTNAME=pocketbase
|
||||||
|
- PB_USERNAME=admin@123.com
|
||||||
|
- PB_PASSWORD=Aa12345678
|
||||||
|
ports:
|
||||||
|
- 8080:3000
|
||||||
|
# command: sleep infinity
|
||||||
|
command: ./entrypoint.sh
|
||||||
|
# depends_on:
|
||||||
|
# pocketbase:
|
||||||
|
# condition: service_healthy
|
||||||
|
# healthcheck:
|
||||||
|
# #optional (recommended) since v0.10.0
|
||||||
|
# test: wget --no-verbose --tries=1 --spider http://localhost:3000 || exit 1
|
||||||
|
# interval: 5s
|
||||||
|
# timeout: 5s
|
||||||
|
# retries: 5
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
cpus: 0.5
|
||||||
|
reservations:
|
||||||
|
cpus: 0.01
|
23315
002_source/pocketbase/pb_data/types.d.ts
vendored
23315
002_source/pocketbase/pb_data/types.d.ts
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,16 +1,31 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
DB_COMPOSE_FILE="-f ./docker-compose.db.yml"
|
||||||
|
_COMPOSE_FILE="-f ./docker-compose.yml"
|
||||||
|
DEV_COMPOSE_FILE="-f ./docker-compose.dev.yml"
|
||||||
|
|
||||||
|
COMPOSE_FILES="$DB_COMPOSE_FILE $_COMPOSE_FILE $DEV_COMPOSE_FILE"
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
cd docker
|
||||||
|
|
||||||
|
docker compose $COMPOSE_FILES kill
|
||||||
|
docker compose $COMPOSE_FILES down
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
docker compose kill
|
docker compose $COMPOSE_FILES up -d pocketbase api_ts --remove-orphans
|
||||||
docker compose down
|
|
||||||
|
|
||||||
docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d pocketbase api_ts --remove-orphans
|
docker compose $COMPOSE_FILES logs pocketbase
|
||||||
docker compose logs pocketbase
|
|
||||||
|
|
||||||
echo "done"
|
echo "done"
|
||||||
|
|
||||||
|
sudo chown 1000:1000 -R ./volumes
|
||||||
|
|
||||||
echo "please run yourself !!!!"
|
echo "please run yourself !!!!"
|
||||||
echo "nodemon -w /pb_hooks --exec "pocketbase seed""
|
echo "nodemon -w /pb_hooks --exec "pocketbase seed""
|
||||||
echo ""
|
echo ""
|
||||||
docker compose exec -it pocketbase sh
|
docker compose $COMPOSE_FILES exec -it pocketbase sh
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
Reference in New Issue
Block a user