mirror of
https://github.com/xbgmsharp/postgsail.git
synced 2025-09-17 03:07:47 +00:00
Udpate docker-compose file. refactor services and network
This commit is contained in:
@@ -1 +0,0 @@
|
||||
docker-compose.yml
|
112
docker-compose.dev.yml
Normal file
112
docker-compose.dev.yml
Normal file
@@ -0,0 +1,112 @@
|
||||
version: "3.9"
|
||||
|
||||
services:
|
||||
dev:
|
||||
container_name: dev
|
||||
image: mcr.microsoft.com/devcontainers/base:ubuntu
|
||||
volumes:
|
||||
- ../:/workspaces:cached
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
#network_mode: service:db
|
||||
links:
|
||||
- "api:postgrest"
|
||||
- "db:database"
|
||||
#- "web_dev:web_dev"
|
||||
command: sleep infinity
|
||||
|
||||
pgadmin:
|
||||
image: dpage/pgadmin4:latest
|
||||
container_name: pgadmin
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- data:/var/lib/pgadmin
|
||||
- ./pgadmin_servers.json:/servers.json:ro
|
||||
links:
|
||||
- "db:database"
|
||||
ports:
|
||||
- 5050:5050
|
||||
environment:
|
||||
- PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL}
|
||||
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD}
|
||||
- PGADMIN_LISTEN_ADDRESS=0.0.0.0
|
||||
- PGADMIN_LISTEN_PORT=5050
|
||||
- PGADMIN_SERVER_JSON_FILE=/servers.json
|
||||
- PGADMIN_DISABLE_POSTFIX=true
|
||||
depends_on:
|
||||
- db
|
||||
logging:
|
||||
options:
|
||||
max-size: 10m
|
||||
|
||||
swagger:
|
||||
image: swaggerapi/swagger-ui
|
||||
container_name: swagger
|
||||
restart: unless-stopped
|
||||
links:
|
||||
- "api:postgrest"
|
||||
ports:
|
||||
- "8181:8080"
|
||||
expose:
|
||||
- "8080"
|
||||
environment:
|
||||
- API_URL=http://api:3000/
|
||||
depends_on:
|
||||
- db
|
||||
- api
|
||||
logging:
|
||||
options:
|
||||
max-size: 10m
|
||||
|
||||
tests:
|
||||
image: xbgmsharp/postgsail-tests
|
||||
build:
|
||||
context: ./tests
|
||||
dockerfile: Dockerfile
|
||||
container_name: tests
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./tests:/mnt
|
||||
working_dir: /mnt
|
||||
command: 'bash tests.sh'
|
||||
links:
|
||||
- "api:postgrest"
|
||||
env_file: .env
|
||||
environment:
|
||||
- POSTGRES_USER=${POSTGRES_USER}
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
- PGPASSWORD=${POSTGRES_PASSWORD}
|
||||
- PGSAIL_API_URL=${PGSAIL_API_URL}
|
||||
depends_on:
|
||||
- db
|
||||
- api
|
||||
logging:
|
||||
options:
|
||||
max-size: 10m
|
||||
|
||||
web_dev:
|
||||
image: xbgmsharp/postgsail-vuestic:dev
|
||||
build:
|
||||
context: https://github.com/xbgmsharp/vuestic-postgsail.git#live
|
||||
dockerfile: Dockerfile_dev
|
||||
container_name: web_dev
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./frontend:/app
|
||||
links:
|
||||
- "api:postgrest"
|
||||
ports:
|
||||
- 8080:8080
|
||||
environment:
|
||||
- VITE_PGSAIL_URL=${PGSAIL_API_URL}
|
||||
- VITE_APP_INCLUDE_DEMOS=false
|
||||
- VITE_APP_BUILD_VERSION=true
|
||||
- VITE_APP_TITLE=${VITE_APP_TITLE}
|
||||
depends_on:
|
||||
- db
|
||||
- api
|
||||
logging:
|
||||
options:
|
||||
max-size: 10m
|
||||
|
||||
volumes:
|
||||
data: {}
|
@@ -1,10 +1,12 @@
|
||||
version: '3.9'
|
||||
version: "3.9"
|
||||
|
||||
services:
|
||||
db:
|
||||
image: xbgmsharp/timescaledb-postgis
|
||||
container_name: db
|
||||
hostname: db
|
||||
restart: unless-stopped
|
||||
#env_file: .env
|
||||
env_file: .env
|
||||
environment:
|
||||
- TIMESCALEDB_TELEMETRY=off
|
||||
- PGDATA=/var/lib/postgresql/data/pgdata
|
||||
@@ -13,15 +15,11 @@ services:
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
- POSTGRES_DB=${POSTGRES_DB}
|
||||
- PGSAIL_AUTHENTICATOR_PASSWORD=${PGSAIL_AUTHENTICATOR_PASSWORD}
|
||||
#network_mode: "host"
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- ./db-data:/var/lib/postgresql/data
|
||||
- ./initdb:/docker-entrypoint-initdb.d
|
||||
networks:
|
||||
iot:
|
||||
ipv4_address: 172.30.0.2
|
||||
logging:
|
||||
options:
|
||||
max-size: 10m
|
||||
@@ -35,10 +33,13 @@ services:
|
||||
api:
|
||||
image: postgrest/postgrest
|
||||
container_name: api
|
||||
hostname: api
|
||||
restart: unless-stopped
|
||||
links:
|
||||
- "db:database"
|
||||
ports:
|
||||
- "3000:3000"
|
||||
#env_file: .env
|
||||
env_file: .env
|
||||
environment:
|
||||
PGRST_DB_SCHEMA: api
|
||||
PGRST_DB_ANON_ROLE: api_anonymous
|
||||
@@ -46,9 +47,6 @@ services:
|
||||
PGRST_DB_PRE_REQUEST: public.check_jwt
|
||||
PGRST_DB_URI: ${PGRST_DB_URI}
|
||||
PGRST_JWT_SECRET: ${PGRST_JWT_SECRET}
|
||||
networks:
|
||||
iot:
|
||||
ipv4_address: 172.30.0.3
|
||||
depends_on:
|
||||
- db
|
||||
logging:
|
||||
@@ -61,70 +59,18 @@ services:
|
||||
# retries: 5
|
||||
# start_period: 100s
|
||||
|
||||
web:
|
||||
image: xbgmsharp/vuestic-postgsail:dev
|
||||
build:
|
||||
context: https://github.com/xbgmsharp/vuestic-postgsail.git#live
|
||||
dockerfile: Dockerfile_dev
|
||||
container_name: web_dev
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./frontend:/app
|
||||
networks:
|
||||
iot:
|
||||
ipv4_address: 172.30.0.4
|
||||
ports:
|
||||
- 8080:8080
|
||||
environment:
|
||||
- VITE_PGSAIL_URL=${PGSAIL_API_URL}
|
||||
- VITE_APP_INCLUDE_DEMOS=false
|
||||
- VITE_APP_BUILD_VERSION=true
|
||||
- VITE_APP_TITLE=${VITE_APP_TITLE}
|
||||
depends_on:
|
||||
- db
|
||||
- api
|
||||
logging:
|
||||
options:
|
||||
max-size: 10m
|
||||
|
||||
pgadmin:
|
||||
image: dpage/pgadmin4:latest
|
||||
container_name: pgadmin
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- data:/var/lib/pgadmin
|
||||
- ./pgadmin_servers.json:/servers.json:ro
|
||||
ports:
|
||||
- 5050:5050
|
||||
environment:
|
||||
- PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL}
|
||||
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD}
|
||||
- PGADMIN_LISTEN_ADDRESS=0.0.0.0
|
||||
- PGADMIN_LISTEN_PORT=5050
|
||||
- PGADMIN_SERVER_JSON_FILE=/servers.json
|
||||
- PGADMIN_DISABLE_POSTFIX=true
|
||||
networks:
|
||||
iot:
|
||||
ipv4_address: 172.30.0.5
|
||||
depends_on:
|
||||
- db
|
||||
logging:
|
||||
options:
|
||||
max-size: 10m
|
||||
|
||||
app:
|
||||
image: grafana/grafana:latest
|
||||
container_name: app
|
||||
restart: unless-stopped
|
||||
links:
|
||||
- "db:database"
|
||||
volumes:
|
||||
- data:/var/lib/grafana
|
||||
- data:/var/log/grafana
|
||||
- ./grafana:/etc/grafana
|
||||
ports:
|
||||
- "3001:3000"
|
||||
networks:
|
||||
iot:
|
||||
ipv4_address: 172.30.0.6
|
||||
environment:
|
||||
- GF_INSTALL_PLUGINS=pr0ps-trackmap-panel,fatcloud-windrose-panel
|
||||
- GF_USERS_ALLOW_SIGN_UP=false
|
||||
@@ -145,13 +91,10 @@ services:
|
||||
image: xbgmsharp/postgsail-telegram-bot
|
||||
container_name: telegram
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- /etc/resolv.conf:/etc/resolv.conf:ro
|
||||
links:
|
||||
- "api:postgrest"
|
||||
ports:
|
||||
- "3005:8080"
|
||||
networks:
|
||||
iot:
|
||||
ipv4_address: 172.30.0.7
|
||||
environment:
|
||||
- BOT_TOKEN=${PGSAIL_TELEGRAM_BOT_TOKEN}
|
||||
- PGSAIL_URL=${PGSAIL_API_URL}
|
||||
@@ -162,19 +105,19 @@ services:
|
||||
options:
|
||||
max-size: 10m
|
||||
|
||||
swagger:
|
||||
image: swaggerapi/swagger-ui
|
||||
container_name: swagger
|
||||
web:
|
||||
image: xbgmsharp/postgsail-vuestic
|
||||
container_name: web
|
||||
restart: unless-stopped
|
||||
links:
|
||||
- "api:postgrest"
|
||||
ports:
|
||||
- "8181:8080"
|
||||
expose:
|
||||
- "8080"
|
||||
- 8080:8080
|
||||
environment:
|
||||
API_URL: http://172.30.0.3:3000/
|
||||
networks:
|
||||
iot:
|
||||
ipv4_address: 172.30.0.8
|
||||
- VITE_PGSAIL_URL=${PGSAIL_API_URL}
|
||||
- VITE_APP_INCLUDE_DEMOS=false
|
||||
- VITE_APP_BUILD_VERSION=true
|
||||
- VITE_APP_TITLE=${VITE_APP_TITLE}
|
||||
depends_on:
|
||||
- db
|
||||
- api
|
||||
@@ -184,12 +127,3 @@ services:
|
||||
|
||||
volumes:
|
||||
data: {}
|
||||
|
||||
networks:
|
||||
iot:
|
||||
driver: bridge
|
||||
ipam:
|
||||
driver: default
|
||||
config:
|
||||
- subnet: 172.30.0.0/24
|
||||
gateway: 172.30.0.1
|
||||
|
Reference in New Issue
Block a user