docker-compose.yml
Rama main · réplica de lectura del repositorio original.
services:
frontend:
image: chamikajaycey/worklenz-frontend:3.3.1
container_name: worklenz_frontend
ports:
- "5000:5000"
depends_on:
- backend
restart: unless-stopped
env_file:
- ./.env
networks:
- worklenz
backend:
image: chamikajaycey/worklenz-backend:3.3.1
container_name: worklenz_backend
ports:
- "3000:3000"
depends_on:
db:
condition: service_healthy
seaweedfs:
condition: service_healthy
configure-seaweedfs:
condition: service_completed_successfully
restart: unless-stopped
env_file:
- ./.env
environment:
DB_HOST: db
DB_PORT: 5432
S3_ENDPOINT: ${S3_ENDPOINT:-http://seaweedfs:8333}
S3_PUBLIC_URL: ${S3_PUBLIC_URL:-http://localhost:${SEAWEEDFS_S3_PORT:-8333}/${S3_BUCKET:-worklenz-bucket}}
# Allows the current published image to start when Google OAuth is not configured.
# Replace these defaults with real credentials in .env to enable Google sign-in.
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID:-disabled}
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET:-disabled}
GOOGLE_CALLBACK_URL: ${GOOGLE_CALLBACK_URL:-https://localhost/api/auth/google/verify}
WORKLENZ_DEPLOYMENT_MODE: ${WORKLENZ_DEPLOYMENT_MODE:-self_hosted}
networks:
- worklenz
client-portal:
image: chamikajaycey/worklenz-client-portal:3.3.1
container_name: worklenz_client_portal
ports:
- "5174:5174"
depends_on:
- backend
restart: unless-stopped
networks:
- worklenz
seaweedfs:
image: chrislusf/seaweedfs:4.41
container_name: worklenz_seaweedfs
ports:
- "${SEAWEEDFS_S3_PORT:-8333}:8333"
restart: unless-stopped
environment:
AWS_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID:-${AWS_ACCESS_KEY_ID:-worklenz}}
AWS_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY:-${AWS_SECRET_ACCESS_KEY:?Set S3_SECRET_ACCESS_KEY or AWS_SECRET_ACCESS_KEY}}
S3_BUCKET: ${S3_BUCKET:-${AWS_BUCKET:-worklenz-bucket}}
volumes:
- worklenz_seaweedfs_data:/data
command: ["mini", "-dir=/data"]
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:9333/cluster/status"]
interval: 10s
timeout: 5s
retries: 10
start_period: 20s
networks:
- worklenz
configure-seaweedfs:
image: amazon/aws-cli:2.27.49
container_name: worklenz_configure_seaweedfs
depends_on:
seaweedfs:
condition: service_healthy
restart: on-failure
environment:
AWS_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID:-${AWS_ACCESS_KEY_ID:-worklenz}}
AWS_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY:-${AWS_SECRET_ACCESS_KEY:?Set S3_SECRET_ACCESS_KEY or AWS_SECRET_ACCESS_KEY}}
AWS_DEFAULT_REGION: ${S3_REGION:-${AWS_REGION:-us-east-1}}
S3_BUCKET: ${S3_BUCKET:-${AWS_BUCKET:-worklenz-bucket}}
entrypoint: ["/bin/sh", "-c"]
command:
- |
if ! aws --endpoint-url http://seaweedfs:8333 s3api create-bucket --bucket "$${S3_BUCKET}"; then
aws --endpoint-url http://seaweedfs:8333 s3api head-bucket --bucket "$${S3_BUCKET}"
fi
networks:
- worklenz
nginx:
image: nginx:alpine
container_name: worklenz_nginx
ports:
- "80:80"
- "443:443"
depends_on:
- frontend
- backend
restart: unless-stopped
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/conf.d:/etc/nginx/conf.d:ro
- ./nginx/ssl:/etc/nginx/ssl:ro
networks:
- worklenz
db:
image: postgres:15
container_name: worklenz_db
environment:
POSTGRES_USER: ${DB_USER:-postgres}
POSTGRES_DB: ${DB_NAME:-worklenz_db}
POSTGRES_PASSWORD: ${DB_PASSWORD:-password}
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -d ${DB_NAME:-worklenz_db} -U ${DB_USER:-postgres}",
]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
- worklenz
volumes:
- worklenz_postgres_data:/var/lib/postgresql/data
- type: bind
source: ./worklenz-backend/database/sql
target: /docker-entrypoint-initdb.d/sql
consistency: cached
- type: bind
source: ./worklenz-backend/database/00_init.sh
target: /docker-entrypoint-initdb.d/00_init.sh
consistency: cached
- type: bind
source: ./pg_backups
target: /docker-entrypoint-initdb.d/pg_backups
command: >
bash -c '
if command -v apt-get >/dev/null 2>&1; then
apt-get update && apt-get install -y dos2unix
elif command -v apk >/dev/null 2>&1; then
apk add --no-cache dos2unix
fi
find /docker-entrypoint-initdb.d -type f -name "*.sh" -exec sh -c '"'"'
for f; do
dos2unix "$$f" 2>/dev/null || true
chmod +x "$$f"
done
'"'"' sh {} +
exec docker-entrypoint.sh postgres
'
db-backup:
image: postgres:15
container_name: worklenz_db_backup
environment:
POSTGRES_USER: ${DB_USER:-postgres}
POSTGRES_DB: ${DB_NAME:-worklenz_db}
POSTGRES_PASSWORD: ${DB_PASSWORD:-password}
depends_on:
db:
condition: service_healthy
volumes:
- ./pg_backups:/pg_backups #host dir for backups files
#setup bassh loop to backup data evey 24h
command: >
bash -c 'while true; do
sleep 86400;
PGPASSWORD=$$POSTGRES_PASSWORD pg_dump -h worklenz_db -U $$POSTGRES_USER -d $$POSTGRES_DB \
> /pg_backups/worklenz_db_$$(date +%Y-%m-%d_%H-%M-%S).sql;
find /pg_backups -type f -name "*.sql" -mtime +30 -delete;
done'
restart: unless-stopped
networks:
- worklenz
volumes:
worklenz_postgres_data:
worklenz_seaweedfs_data:
name: worklenz_seaweedfs_data
pgdata:
networks:
worklenz: