# -weight: 500;">docker-compose.yml
services: api: build: . ports: - "8080:8080" environment: - DATABASE_URL=postgres://app:secret@db:5432/myapp - REDIS_URL=redis://cache:6379 depends_on: db: condition: service_healthy healthcheck: test: ["CMD", "-weight: 500;">curl", "-f", "http://localhost:8080/health"] interval: 10s db: image: postgres:16-alpine environment: POSTGRES_USER: app POSTGRES_PASSWORD: secret POSTGRES_DB: myapp volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD", "pg_isready", "-U", "app"] cache: image: redis:7-alpine volumes: pgdata:
# -weight: 500;">docker-compose.yml
services: api: build: . ports: - "8080:8080" environment: - DATABASE_URL=postgres://app:secret@db:5432/myapp - REDIS_URL=redis://cache:6379 depends_on: db: condition: service_healthy healthcheck: test: ["CMD", "-weight: 500;">curl", "-f", "http://localhost:8080/health"] interval: 10s db: image: postgres:16-alpine environment: POSTGRES_USER: app POSTGRES_PASSWORD: secret POSTGRES_DB: myapp volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD", "pg_isready", "-U", "app"] cache: image: redis:7-alpine volumes: pgdata:
# -weight: 500;">docker-compose.yml
services: api: build: . ports: - "8080:8080" environment: - DATABASE_URL=postgres://app:secret@db:5432/myapp - REDIS_URL=redis://cache:6379 depends_on: db: condition: service_healthy healthcheck: test: ["CMD", "-weight: 500;">curl", "-f", "http://localhost:8080/health"] interval: 10s db: image: postgres:16-alpine environment: POSTGRES_USER: app POSTGRES_PASSWORD: secret POSTGRES_DB: myapp volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD", "pg_isready", "-U", "app"] cache: image: redis:7-alpine volumes: pgdata:
project/
├── -weight: 500;">docker-compose.yml # Local dev
├── Dockerfile
├── k8s/
│ ├── base/
│ │ ├── deployment.yaml
│ │ ├── -weight: 500;">service.yaml
│ │ └── kustomization.yaml
│ └── overlays/
│ ├── staging/
│ └── production/
└── Makefile
project/
├── -weight: 500;">docker-compose.yml # Local dev
├── Dockerfile
├── k8s/
│ ├── base/
│ │ ├── deployment.yaml
│ │ ├── -weight: 500;">service.yaml
│ │ └── kustomization.yaml
│ └── overlays/
│ ├── staging/
│ └── production/
└── Makefile
project/
├── -weight: 500;">docker-compose.yml # Local dev
├── Dockerfile
├── k8s/
│ ├── base/
│ │ ├── deployment.yaml
│ │ ├── -weight: 500;">service.yaml
│ │ └── kustomization.yaml
│ └── overlays/
│ ├── staging/
│ └── production/
└── Makefile
# k8s/base/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata: name: api
spec: replicas: 2 selector: matchLabels: app: api template: metadata: labels: app: api spec: containers: - name: api image: iad.ocir.io/mytenancy/myapp:latest ports: - containerPort: 8080 envFrom: - secretRef: name: app-secrets readinessProbe: httpGet: path: /health port: 8080 periodSeconds: 10
# k8s/base/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata: name: api
spec: replicas: 2 selector: matchLabels: app: api template: metadata: labels: app: api spec: containers: - name: api image: iad.ocir.io/mytenancy/myapp:latest ports: - containerPort: 8080 envFrom: - secretRef: name: app-secrets readinessProbe: httpGet: path: /health port: 8080 periodSeconds: 10
# k8s/base/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata: name: api
spec: replicas: 2 selector: matchLabels: app: api template: metadata: labels: app: api spec: containers: - name: api image: iad.ocir.io/mytenancy/myapp:latest ports: - containerPort: 8080 envFrom: - secretRef: name: app-secrets readinessProbe: httpGet: path: /health port: 8080 periodSeconds: 10
# k8s/overlays/production/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: production
resources: - ../../base
images: - name: iad.ocir.io/mytenancy/myapp newTag: v1.2.3
# k8s/overlays/production/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: production
resources: - ../../base
images: - name: iad.ocir.io/mytenancy/myapp newTag: v1.2.3
# k8s/overlays/production/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: production
resources: - ../../base
images: - name: iad.ocir.io/mytenancy/myapp newTag: v1.2.3
# Makefile
dev: -weight: 500;">docker compose up --build build: -weight: 500;">docker build -t iad.ocir.io/$(TENANCY)/myapp:$(TAG) . -weight: 500;">docker push iad.ocir.io/$(TENANCY)/myapp:$(TAG) deploy-staging: -weight: 500;">kubectl apply -k k8s/overlays/staging check-alignment: @echo "=== Compose ports ===" && grep -A1 "ports:" -weight: 500;">docker-compose.yml @echo "=== K8s ports ===" && grep "containerPort" k8s/base/deployment.yaml @echo "=== Compose health ===" && grep "test:" -weight: 500;">docker-compose.yml @echo "=== K8s health ===" && grep "path:" k8s/base/deployment.yaml
# Makefile
dev: -weight: 500;">docker compose up --build build: -weight: 500;">docker build -t iad.ocir.io/$(TENANCY)/myapp:$(TAG) . -weight: 500;">docker push iad.ocir.io/$(TENANCY)/myapp:$(TAG) deploy-staging: -weight: 500;">kubectl apply -k k8s/overlays/staging check-alignment: @echo "=== Compose ports ===" && grep -A1 "ports:" -weight: 500;">docker-compose.yml @echo "=== K8s ports ===" && grep "containerPort" k8s/base/deployment.yaml @echo "=== Compose health ===" && grep "test:" -weight: 500;">docker-compose.yml @echo "=== K8s health ===" && grep "path:" k8s/base/deployment.yaml
# Makefile
dev: -weight: 500;">docker compose up --build build: -weight: 500;">docker build -t iad.ocir.io/$(TENANCY)/myapp:$(TAG) . -weight: 500;">docker push iad.ocir.io/$(TENANCY)/myapp:$(TAG) deploy-staging: -weight: 500;">kubectl apply -k k8s/overlays/staging check-alignment: @echo "=== Compose ports ===" && grep -A1 "ports:" -weight: 500;">docker-compose.yml @echo "=== K8s ports ===" && grep "containerPort" k8s/base/deployment.yaml @echo "=== Compose health ===" && grep "test:" -weight: 500;">docker-compose.yml @echo "=== K8s health ===" && grep "path:" k8s/base/deployment.yaml - Database — Container locally, OCI managed -weight: 500;">service in production. I don't run databases on K8s.
- Secrets — Plain text in Compose, OCI Vault via External Secrets Operator on OKE.
- Scaling — One replica locally, HPA on OKE.