Add initial project files
This commit is contained in:
Executable
+145
@@ -0,0 +1,145 @@
|
||||
services:
|
||||
backend:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: apps/backend/Dockerfile
|
||||
env_file:
|
||||
- ./apps/backend/.env
|
||||
container_name: crux_backend_adonis
|
||||
ports:
|
||||
- "3333:3333"
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_started
|
||||
redis:
|
||||
condition: service_started
|
||||
minio_create_bucket:
|
||||
condition: service_completed_successfully
|
||||
volumes:
|
||||
- ./apps/backend:/app/apps/backend:cached
|
||||
- ./apps/admin:/app/apps/admin:cached
|
||||
- /app/apps/backend/node_modules
|
||||
working_dir: /app/apps/backend
|
||||
|
||||
environment:
|
||||
HOST: 0.0.0.0
|
||||
PORT: 3333
|
||||
NODE_ENV: development
|
||||
DB_CONNECTION: pg
|
||||
DB_HOST: postgres
|
||||
DB_PORT: 5432
|
||||
DB_USER: postgres
|
||||
DB_PASSWORD: postgres
|
||||
DB_DATABASE: adonis
|
||||
DRIVE_DISK: s3
|
||||
AWS_ACCESS_KEY_ID: minioadmin
|
||||
AWS_SECRET_ACCESS_KEY: minioadmin
|
||||
AWS_REGION: us-east-1
|
||||
S3_BUCKET: crux-drive
|
||||
S3_ENDPOINT: http://minio:9000
|
||||
S3_CDN_URL: http://localhost:9000/crux-drive/
|
||||
REDIS_CONNECTION: local
|
||||
REDIS_HOST: redis
|
||||
REDIS_PORT: 6379
|
||||
WEB_APP_URL: http://web:3000 # Server-side URL: resolved inside the container, so it must use the compose service name, not localhost.
|
||||
command: sh -c "node ace migration:run && node ace db:seed && npm run dev"
|
||||
|
||||
postgres:
|
||||
image: postgres:17
|
||||
container_name: crux_postgres
|
||||
ports:
|
||||
- "5432:5432"
|
||||
environment:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: adonis
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
|
||||
redis:
|
||||
image: redis:8.0-M03
|
||||
container_name: crux_redis
|
||||
ports:
|
||||
- "6379:6379"
|
||||
|
||||
minio:
|
||||
image: minio/minio:latest
|
||||
container_name: crux_minio
|
||||
ports:
|
||||
- "9000:9000"
|
||||
- "9001:9001"
|
||||
environment:
|
||||
MINIO_ROOT_USER: minioadmin
|
||||
MINIO_ROOT_PASSWORD: minioadmin
|
||||
volumes:
|
||||
- minio_data:/data
|
||||
command: server /data --console-address ":9001"
|
||||
|
||||
minio_create_bucket:
|
||||
image: minio/mc:latest
|
||||
container_name: crux_minio_create_bucket
|
||||
depends_on:
|
||||
- minio
|
||||
entrypoint: >
|
||||
/bin/sh -c "
|
||||
until mc alias set local http://minio:9000 minioadmin minioadmin >/dev/null 2>&1; do sleep 2; done;
|
||||
mc mb --ignore-existing local/crux-drive;
|
||||
mc anonymous set download local/crux-drive;
|
||||
"
|
||||
|
||||
pgadmin:
|
||||
image: dpage/pgadmin4
|
||||
container_name: crux_pgadmin
|
||||
ports:
|
||||
- "5050:80"
|
||||
environment:
|
||||
PGADMIN_DEFAULT_EMAIL: admin@admin.com
|
||||
PGADMIN_DEFAULT_PASSWORD: admin
|
||||
volumes:
|
||||
- pgadmin_data:/var/lib/pgadmin
|
||||
depends_on:
|
||||
- postgres
|
||||
|
||||
admin:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: apps/admin/Dockerfile
|
||||
env_file:
|
||||
- ./apps/admin/.env
|
||||
container_name: crux_admin_react
|
||||
working_dir: /app/apps/admin
|
||||
ports:
|
||||
- "5173:5173"
|
||||
volumes:
|
||||
- ./apps/admin:/app/apps/admin:cached
|
||||
- /app/apps/admin/node_modules
|
||||
environment:
|
||||
- CHOKIDAR_USEPOLLING=true
|
||||
command: sh -c "npm run dev"
|
||||
|
||||
web:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: apps/web/Dockerfile
|
||||
env_file:
|
||||
- ./apps/web/.env
|
||||
container_name: crux_web_next
|
||||
working_dir: /app/apps/web
|
||||
ports:
|
||||
- "3000:3000"
|
||||
depends_on:
|
||||
- backend
|
||||
volumes:
|
||||
- ./apps/web:/app/apps/web:cached
|
||||
- /app/apps/web/node_modules
|
||||
- /app/apps/web/.next
|
||||
environment:
|
||||
HOSTNAME: 0.0.0.0
|
||||
PORT: 3000
|
||||
WATCHPACK_POLLING: "true"
|
||||
BACKEND_API_URL: http://backend:3333 # Server-side URL: resolved inside the container, so it must use the compose service name, not localhost.
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
pgadmin_data:
|
||||
minio_data:
|
||||
Reference in New Issue
Block a user