feat(devcontainer): add Docker and devcontainer configuration for NowChess workspace
This commit is contained in:
@@ -0,0 +1,9 @@
|
|||||||
|
FROM mcr.microsoft.com/devcontainers/java:21-bookworm
|
||||||
|
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
postgresql-client \
|
||||||
|
redis-tools \
|
||||||
|
stockfish \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# Devcontainer
|
||||||
|
|
||||||
|
Dieses Setup startet den NowChess-Workspace zusammen mit Redis und PostgreSQL.
|
||||||
|
|
||||||
|
## Enthaltene Services
|
||||||
|
- `workspace` – Scala/Gradle-Entwicklungscontainer
|
||||||
|
- `redis` – Redis 7.4
|
||||||
|
- `postgres` – PostgreSQL 16
|
||||||
|
|
||||||
|
## Wichtige Ports
|
||||||
|
- App-Services: `8080`, `8081`, `8082`, `8083`, `8084`, `8085`, `8086`, `9086`
|
||||||
|
- Redis auf dem Host: `16379`
|
||||||
|
- PostgreSQL auf dem Host: `15432`
|
||||||
|
|
||||||
|
## Einstieg
|
||||||
|
- VS Code: Ordner in einem Dev Container öffnen
|
||||||
|
- IntelliJ: Dev Container / Docker-Compose-Workspace öffnen und den `workspace`-Dienst nutzen
|
||||||
|
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
"name": "NowChessSystems",
|
||||||
|
"dockerComposeFile": ["docker-compose.yml"],
|
||||||
|
"service": "workspace",
|
||||||
|
"workspaceFolder": "/workspaces/NowChessSystems",
|
||||||
|
"shutdownAction": "stopCompose",
|
||||||
|
"overrideCommand": false,
|
||||||
|
"remoteUser": "vscode",
|
||||||
|
"forwardPorts": [8080, 8081, 8082, 8083, 8084, 8085, 8086, 9086],
|
||||||
|
"portsAttributes": {
|
||||||
|
"8080": {"label": "NowChess Core", "onAutoForward": "notify"},
|
||||||
|
"8081": {"label": "NowChess Io", "onAutoForward": "notify"},
|
||||||
|
"8082": {"label": "NowChess Rule", "onAutoForward": "notify"},
|
||||||
|
"8083": {"label": "NowChess Account", "onAutoForward": "notify"},
|
||||||
|
"8084": {"label": "NowChess WebSocket", "onAutoForward": "notify"},
|
||||||
|
"8085": {"label": "NowChess Store", "onAutoForward": "notify"},
|
||||||
|
"8086": {"label": "NowChess Coordinator HTTP", "onAutoForward": "notify"},
|
||||||
|
"9086": {"label": "NowChess Coordinator gRPC", "onAutoForward": "notify"}
|
||||||
|
},
|
||||||
|
"customizations": {
|
||||||
|
"vscode": {
|
||||||
|
"settings": {
|
||||||
|
"java.configuration.updateBuildConfiguration": "automatic",
|
||||||
|
"java.import.gradle.wrapper.enabled": true,
|
||||||
|
"files.watcherExclude": {
|
||||||
|
"**/build/**": true,
|
||||||
|
"**/.gradle/**": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"extensions": [
|
||||||
|
"scala-lang.scala",
|
||||||
|
"redhat.java",
|
||||||
|
"vscjava.vscode-java-pack"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"postCreateCommand": "bash -lc './gradlew --no-daemon help >/dev/null'"
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
services:
|
||||||
|
workspace:
|
||||||
|
build:
|
||||||
|
context: ..
|
||||||
|
dockerfile: .devcontainer/Dockerfile
|
||||||
|
command: sleep infinity
|
||||||
|
init: true
|
||||||
|
volumes:
|
||||||
|
- gradle-cache:/home/vscode/.gradle
|
||||||
|
environment:
|
||||||
|
REDIS_HOST: redis
|
||||||
|
REDIS_PORT: 6379
|
||||||
|
REDIS_PREFIX: nowchess
|
||||||
|
DB_URL: jdbc:postgresql://postgres:5432/nowchess
|
||||||
|
DB_USER: nowchess
|
||||||
|
DB_PASSWORD: nowchess
|
||||||
|
CORE_SERVICE_URL: http://localhost:8080
|
||||||
|
INTERNAL_SECRET: dev-internal-secret
|
||||||
|
STOCKFISH_PATH: /usr/games/stockfish
|
||||||
|
NOWCHESS_COORDINATOR_ENABLED: "true"
|
||||||
|
depends_on:
|
||||||
|
redis:
|
||||||
|
condition: service_healthy
|
||||||
|
postgres:
|
||||||
|
condition: service_healthy
|
||||||
|
|
||||||
|
redis:
|
||||||
|
image: redis:7.4-alpine
|
||||||
|
command: ["redis-server", "--appendonly", "yes", "--save", "60", "1"]
|
||||||
|
ports:
|
||||||
|
- "16379:6379"
|
||||||
|
volumes:
|
||||||
|
- redis-data:/data
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "redis-cli", "ping"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 3s
|
||||||
|
retries: 20
|
||||||
|
start_period: 5s
|
||||||
|
|
||||||
|
postgres:
|
||||||
|
image: postgres:16-alpine
|
||||||
|
environment:
|
||||||
|
POSTGRES_DB: nowchess
|
||||||
|
POSTGRES_USER: nowchess
|
||||||
|
POSTGRES_PASSWORD: nowchess
|
||||||
|
ports:
|
||||||
|
- "15432:5432"
|
||||||
|
volumes:
|
||||||
|
- postgres-data:/var/lib/postgresql/data
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 3s
|
||||||
|
retries: 20
|
||||||
|
start_period: 10s
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
gradle-cache:
|
||||||
|
redis-data:
|
||||||
|
postgres-data:
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3.set
|
||||||
"""
|
"""
|
||||||
scoverage Coverage Gap Reporter
|
scoverage Coverage Gap Reporter
|
||||||
Parses a scoverage XML report (scoverage.xml) and outputs missing statement
|
Parses a scoverage XML report (scoverage.xml) and outputs missing statement
|
||||||
|
|||||||
@@ -1,16 +1,21 @@
|
|||||||
quarkus:
|
quarkus:
|
||||||
application.name: nowchess-store
|
application:
|
||||||
|
name: nowchess-store
|
||||||
http.port: 8085
|
http.port: 8085
|
||||||
config.yaml.enabled: true
|
config:
|
||||||
|
yaml:
|
||||||
|
enabled: true
|
||||||
redis:
|
redis:
|
||||||
hosts: redis://${REDIS_HOST:localhost}:${REDIS_PORT:6379}
|
hosts: redis://${REDIS_HOST:localhost}:${REDIS_PORT:6379}
|
||||||
datasource:
|
datasource:
|
||||||
db-kind: postgresql
|
db-kind: postgresql
|
||||||
username: ${DB_USER:nowchess}
|
username: ${DB_USER:nowchess}
|
||||||
password: ${DB_PASSWORD:nowchess}
|
password: ${DB_PASSWORD:nowchess}
|
||||||
jdbc.url: ${DB_URL:jdbc:postgresql://localhost:5432/nowchess}
|
jdbc:
|
||||||
|
url: ${DB_URL:jdbc:postgresql://localhost:5432/nowchess}
|
||||||
hibernate-orm:
|
hibernate-orm:
|
||||||
database.generation: update
|
database:
|
||||||
|
generation: update
|
||||||
|
|
||||||
nowchess:
|
nowchess:
|
||||||
redis:
|
redis:
|
||||||
@@ -24,9 +29,11 @@ nowchess:
|
|||||||
db-kind: h2
|
db-kind: h2
|
||||||
username: sa
|
username: sa
|
||||||
password: ""
|
password: ""
|
||||||
jdbc.url: jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
|
jdbc:
|
||||||
|
url: jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
|
||||||
hibernate-orm:
|
hibernate-orm:
|
||||||
database.generation: drop-and-create
|
database:
|
||||||
|
generation: drop-and-create
|
||||||
nowchess:
|
nowchess:
|
||||||
redis:
|
redis:
|
||||||
host: localhost
|
host: localhost
|
||||||
|
|||||||
@@ -5,12 +5,6 @@ quarkus:
|
|||||||
name: nowchess-ws
|
name: nowchess-ws
|
||||||
redis:
|
redis:
|
||||||
hosts: redis://${REDIS_HOST:localhost}:${REDIS_PORT:6379}
|
hosts: redis://${REDIS_HOST:localhost}:${REDIS_PORT:6379}
|
||||||
swagger-ui:
|
|
||||||
always-include: true
|
|
||||||
path: /swagger-ui
|
|
||||||
grpc:
|
|
||||||
server:
|
|
||||||
use-separate-server: false
|
|
||||||
|
|
||||||
nowchess:
|
nowchess:
|
||||||
redis:
|
redis:
|
||||||
|
|||||||
Reference in New Issue
Block a user