feat: project setup
This commit is contained in:
82
server/docker-compose.yml
Normal file
82
server/docker-compose.yml
Normal file
@@ -0,0 +1,82 @@
|
||||
services:
|
||||
# Postgres Database
|
||||
postgres:
|
||||
image: postgres:17-alpine
|
||||
container_name: ccoin-postgres
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_DB: ccoin
|
||||
POSTGRES_USER: ccoin
|
||||
POSTGRES_PASSWORD: ccoin
|
||||
POSTGRES_INITDB_ARGS: "--encoding=UTF-8 --lc-collate=C --lc-ctype=C"
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
- ./docker/postgres/init:/docker-entrypoint-initdb.d
|
||||
networks:
|
||||
- ccoin-network
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ccoin -d ccoin"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 30s
|
||||
|
||||
# CCoin server
|
||||
ccoin-server:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: ccoin-server
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8080:8080"
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
# Database configuration
|
||||
DATABASE_URL: jdbc:postgresql://postgres:5432/ccoin
|
||||
DATABASE_USER: ccoin
|
||||
DATABASE_PASSWORD: ccoin
|
||||
DATABASE_POOL_SIZE: 20
|
||||
|
||||
# Server configuration
|
||||
SERVER_HOST: 0.0.0.0
|
||||
SERVER_PORT: 8080
|
||||
|
||||
# Mining configuration
|
||||
MINING_DIFFICULTY: 4
|
||||
MINING_REWARD: 50.0
|
||||
BLOCK_TIME_TARGET: 600000
|
||||
|
||||
# Security
|
||||
JWT_SECRET: your-super-secret-jwt-key-change-this-in-production
|
||||
|
||||
# Logging
|
||||
LOG_LEVEL: INFO
|
||||
|
||||
# Development
|
||||
DEVELOPMENT_MODE: false
|
||||
volumes:
|
||||
- ./logs:/app/logs
|
||||
networks:
|
||||
- ccoin-network
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 60s
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
ccoin-network:
|
||||
driver: bridge
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 172.20.0.0/16
|
||||
Reference in New Issue
Block a user