add docker and docker-compose
This commit is contained in:
@@ -0,0 +1,110 @@
|
||||
services:
|
||||
# PostgreSQL Database
|
||||
postgres:
|
||||
image: postgres:15-alpine
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_DB: medusa-store
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- ${GLOBAL_DATA_FOLDER:-/Data}/${SERVICE_NAME_OVERRIDE:-my-medusa-store}/postgres_data:/var/lib/postgresql/data
|
||||
networks:
|
||||
- default
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres -d medusa-store"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 10s
|
||||
|
||||
# Redis
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "6379:6379"
|
||||
networks:
|
||||
- default
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 10s
|
||||
|
||||
medusa:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.dev
|
||||
args:
|
||||
UID: ${UID:-1000}
|
||||
GID: ${GID:-1000}
|
||||
user: "${UID:-1000}:${GID:-1000}"
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- "9000:9000"
|
||||
environment:
|
||||
- NODE_ENV=development
|
||||
- DATABASE_URL=postgres://postgres:postgres@postgres:5432/medusa-store
|
||||
- REDIS_URL=redis://redis:6379
|
||||
env_file:
|
||||
- .env
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-q", "--spider", "http://localhost:9000/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
start_period: 120s
|
||||
retries: 3
|
||||
develop:
|
||||
watch:
|
||||
- action: sync
|
||||
path: ./packages
|
||||
target: /server/packages
|
||||
- action: sync
|
||||
path: ./medusa-config.js
|
||||
target: /server/medusa-config.js
|
||||
- action: sync
|
||||
path: ./start.sh
|
||||
target: /server/start.sh
|
||||
- action: rebuild
|
||||
path: package.json
|
||||
- action: rebuild
|
||||
path: yarn.lock
|
||||
networks:
|
||||
- default
|
||||
- traefik_default
|
||||
labels:
|
||||
com.centurylinklabs.watchtower.enable: "true"
|
||||
traefik.docker.network: traefik_default
|
||||
traefik.enable: true
|
||||
traefik.http.routers.my-medusa-store.entrypoints: websecure
|
||||
traefik.http.routers.my-medusa-store.rule: Host(`${SERVICE_NAME_OVERRIDE:-my-medusa-store}.${DOMAIN_NAME:-local}`)
|
||||
traefik.http.routers.my-medusa-store.service: my-medusa-store
|
||||
traefik.http.routers.my-medusa-store.tls: true
|
||||
traefik.http.routers.my-medusa-store.tls.certresolver: letsencrypt-cloudflare-dns-challenge
|
||||
traefik.http.services.my-medusa-store.loadbalancer.server.port: 9000
|
||||
local.yacht.port.9000: WebUI
|
||||
traefik.http.routers.my-medusa-store-admin.entrypoints: websecure
|
||||
traefik.http.routers.my-medusa-store-admin.rule: Host(`${SERVICE_NAME_OVERRIDE:-my-medusa-store}-admin.${DOMAIN_NAME:-local}`)
|
||||
traefik.http.routers.my-medusa-store-admin.service: my-medusa-store-admin
|
||||
traefik.http.routers.my-medusa-store-admin.tls: true
|
||||
traefik.http.routers.my-medusa-store-admin.tls.certresolver: letsencrypt-cloudflare-dns-challenge
|
||||
traefik.http.services.my-medusa-store-admin.loadbalancer.server.port: 5173
|
||||
local.yacht.port.5173: WebUI
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
|
||||
networks:
|
||||
default:
|
||||
driver: bridge
|
||||
traefik_default:
|
||||
external: true
|
||||
Reference in New Issue
Block a user