Nixius
/
template
Template
2
1
Fork 1

Remove staging: drop staging compose/stack, CI steps, and docs
ci/woodpecker/push/woodpecker Pipeline was successful Details

- Delete stack.staging.yml and docker-compose.staging.yml
- Remove build-push-staging, deploy-staging, wait-for-deploy-staging, cleanup-staging from .woodpecker.yml
- Dockerfile.production: base on alpine:3.18 instead of staging image
- Update README, .cursor rules and rules.json to remove staging references

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Colin 2026-02-18 10:26:04 -05:00
parent 454a54109e
commit 6be2ec1949
Signed by: colin
SSH Key Fingerprint: SHA256:nRPCQTeMFLdGytxRQmPVK9VXY3/ePKQ5lGRyJhT5DY8
7 changed files with 88 additions and 220 deletions

View File

@ -1,81 +1,85 @@
{
"version": 1,
"rules": [
{
"pattern": "**/*",
"rule": "project-structure.mdc"
},
{
"pattern": "**/docker/template/Dockerfile",
"rule": "dockerfiles.mdc"
},
{
"pattern": "**/docker/template/Dockerfile.production",
"rule": "dockerfiles.mdc"
},
{
"pattern": "**/docker-compose.dev.yml",
"rule": "docker-compose-files.mdc"
},
{
"pattern": "**/docker-compose.staging.yml",
"rule": "docker-compose-files.mdc"
},
{
"pattern": "**/docker-compose.production.yml",
"rule": "docker-compose-files.mdc"
},
{
"pattern": "**/docker-compose.test.yml",
"rule": "docker-compose-files.mdc"
},
{
"pattern": "**/stack.staging.yml",
"rule": "stack-files.mdc"
},
{
"pattern": "**/stack.production.yml",
"rule": "stack-files.mdc"
},
{
"pattern": "**/*.sh",
"rule": "scripts.mdc"
},
{
"pattern": "**/build-test-run.sh",
"rule": "git-workflow.mdc"
},
{
"pattern": "**/temp/**/*",
"rule": ["temp-directory.mdc", "gitkeep-handling.mdc"]
},
{
"pattern": "**/.gitignore",
"rule": "gitignore.mdc"
},
{
"pattern": "**/.git/**/*",
"rule": "git-workflow.mdc"
},
{
"pattern": "**/docker/template/src/**/*",
"rule": ["source-code.mdc", "gitkeep-handling.mdc"]
},
{
"pattern": "**/.gitkeep",
"rule": "gitkeep-handling.mdc"
},
{
"pattern": "**/temp/",
"rule": ["temp-directory.mdc", "gitkeep-handling.mdc"]
},
{
"pattern": "**/docker/template/src/",
"rule": ["source-code.mdc", "gitkeep-handling.mdc"]
},
{
"pattern": "**/.woodpecker.yml",
"rule": "project-structure.mdc"
}
]
}
"version": 1,
"rules": [
{
"pattern": "**/*",
"rule": "project-structure.mdc"
},
{
"pattern": "**/docker/template/Dockerfile",
"rule": "dockerfiles.mdc"
},
{
"pattern": "**/docker/template/Dockerfile.production",
"rule": "dockerfiles.mdc"
},
{
"pattern": "**/docker-compose.dev.yml",
"rule": "docker-compose-files.mdc"
},
{
"pattern": "**/docker-compose.production.yml",
"rule": "docker-compose-files.mdc"
},
{
"pattern": "**/docker-compose.test.yml",
"rule": "docker-compose-files.mdc"
},
{
"pattern": "**/stack.production.yml",
"rule": "stack-files.mdc"
},
{
"pattern": "**/*.sh",
"rule": "scripts.mdc"
},
{
"pattern": "**/build-test-run.sh",
"rule": "git-workflow.mdc"
},
{
"pattern": "**/temp/**/*",
"rule": [
"temp-directory.mdc",
"gitkeep-handling.mdc"
]
},
{
"pattern": "**/.gitignore",
"rule": "gitignore.mdc"
},
{
"pattern": "**/.git/**/*",
"rule": "git-workflow.mdc"
},
{
"pattern": "**/docker/template/src/**/*",
"rule": [
"source-code.mdc",
"gitkeep-handling.mdc"
]
},
{
"pattern": "**/.gitkeep",
"rule": "gitkeep-handling.mdc"
},
{
"pattern": "**/temp/",
"rule": [
"temp-directory.mdc",
"gitkeep-handling.mdc"
]
},
{
"pattern": "**/docker/template/src/",
"rule": [
"source-code.mdc",
"gitkeep-handling.mdc"
]
},
{
"pattern": "**/.woodpecker.yml",
"rule": "project-structure.mdc"
}
]
}

View File

@ -20,19 +20,11 @@ alwaysApply: false
- Configures development environment variables
- Mounts the [temp](mdc:temp) directory for local testing
- [docker-compose.staging.yml](mdc:docker-compose.staging.yml): Staging build configuration
- Builds and tags the staging image
- Used by CI/CD for staging deployments
- [docker-compose.production.yml](mdc:docker-compose.production.yml): Production build configuration
- Builds and tags the production image
- Used by CI/CD for production deployments
## Stack Files
- [stack.staging.yml](mdc:stack.staging.yml): Staging stack deployment
- Configures service deployment for staging environment
- Sets up Traefik routing rules
- [stack.production.yml](mdc:stack.production.yml): Production stack deployment
- Configures service deployment for production environment
- Sets up Traefik routing rules with appropriate security headers

View File

@ -10,70 +10,6 @@ clone:
when:
branch: [main]
steps:
# Build and Push for Staging
build-push-staging:
name: build-push-staging
image: woodpeckerci/plugin-docker-buildx
environment:
REGISTRY_USER:
from_secret: REGISTRY_USER
REGISTRY_PASSWORD:
from_secret: REGISTRY_PASSWORD
DOCKER_REGISTRY_USER:
from_secret: DOCKER_REGISTRY_USER
DOCKER_REGISTRY_PASSWORD:
from_secret: DOCKER_REGISTRY_PASSWORD
volumes:
- /var/run/docker.sock:/var/run/docker.sock
commands:
- echo "nameserver 1.1.1.1" > /etc/resolv.conf
- echo "nameserver 1.0.0.1" >> /etc/resolv.conf
- HOSTNAME=$(docker info --format "{{.Name}}")
- echo "Building on $HOSTNAME"
- echo "$${DOCKER_REGISTRY_PASSWORD}" | docker login -u "$${DOCKER_REGISTRY_USER}" --password-stdin
- echo "$${REGISTRY_PASSWORD}" | docker login -u "$${REGISTRY_USER}" --password-stdin git.nixc.us
- docker compose -f docker-compose.staging.yml build --no-cache
- docker compose -f docker-compose.staging.yml push
when:
branch: main
event: push
# Deploy Staging
deploy-staging:
name: deploy-staging
image: woodpeckerci/plugin-docker-buildx
environment:
REGISTRY_USER:
from_secret: REGISTRY_USER
REGISTRY_PASSWORD:
from_secret: REGISTRY_PASSWORD
volumes:
- /var/run/docker.sock:/var/run/docker.sock
commands:
- echo "nameserver 1.1.1.1" > /etc/resolv.conf
- echo "nameserver 1.0.0.1" >> /etc/resolv.conf
- HOSTNAME=$(docker info --format "{{.Name}}")
- echo "Deploying on $HOSTNAME"
- echo "$${REGISTRY_PASSWORD}" | docker login -u "$${REGISTRY_USER}" --password-stdin git.nixc.us
- docker stack deploy --with-registry-auth -c ./stack.staging.yml $${CI_REPO_NAME}-staging
when:
branch: main
event: push
# Wait for Deploy to Complete
wait-for-deploy-staging:
name: wait-for-deploy-staging
image: woodpeckerci/plugin-docker-buildx
volumes:
- /var/run/docker.sock:/var/run/docker.sock
commands:
- echo "nameserver 1.1.1.1" > /etc/resolv.conf
- echo "nameserver 1.0.0.1" >> /etc/resolv.conf
- sleep 20
when:
branch: main
event: push
# Build and Push for Production
build-push-production:
name: build-push-production
@ -122,28 +58,4 @@ steps:
- docker stack deploy --with-registry-auth -c ./stack.production.yml $${CI_REPO_NAME}
when:
branch: main
event: [push, cron]
# Cleanup Staging Environment
cleanup-staging:
name: cleanup-staging
image: woodpeckerci/plugin-docker-buildx
environment:
REGISTRY_USER:
from_secret: REGISTRY_USER
REGISTRY_PASSWORD:
from_secret: REGISTRY_PASSWORD
volumes:
- /var/run/docker.sock:/var/run/docker.sock
commands:
- echo "nameserver 1.1.1.1" > /etc/resolv.conf
- echo "nameserver 1.0.0.1" >> /etc/resolv.conf
- HOSTNAME=$(docker info --format "{{.Name}}")
- echo "Cleaning up staging environment on $HOSTNAME"
- for i in {1..5}; do docker stack rm $${CI_REPO_NAME}-staging && break || sleep 10; done
- docker compose -f docker-compose.staging.yml down
- docker compose -f docker-compose.staging.yml rm -f
when:
branch: main
event: [push, cron]
status: success
event: [push, cron]

View File

@ -17,9 +17,7 @@ This is a template project that follows a standardized structure for Docker-base
├── temp/ # Local testing scratch space
├── docker-compose.dev.yml # Docker Compose for local development
├── docker-compose.production.yml
├── docker-compose.staging.yml
├── docker-compose.test.yml
├── stack.staging.yml
└── stack.production.yml
```

View File

@ -1,7 +0,0 @@
# The only stuff that happens here is template gets replaced and so does possibly nixius
services:
template:
build:
context: ./docker/template
dockerfile: Dockerfile.staging
image: git.nixc.us/colin/template:staging

View File

@ -1 +1,3 @@
FROM git.nixc.us/nixius/template:staging
FROM alpine:3.18
WORKDIR /app
CMD ["tail", "-f", "/dev/null"]

View File

@ -1,33 +0,0 @@
networks:
traefik:
external: true
default:
services:
template:
image: git.nixc.us/nixius/template:staging
deploy:
labels:
- traefik.enable=true
- traefik.http.routers.staging_template.rule=Host(`staging.template.nixc.us`)
- traefik.http.routers.staging_template.entrypoints=websecure
- traefik.http.routers.staging_template.tls=true
- traefik.http.routers.staging_template.tls.certresolver=letsencryptresolver
- traefik.http.services.staging_template.loadbalancer.server.port=3000
# - traefik.http.services.staging_template.loadbalancer.healthcheck.path=/health
# - traefik.http.services.staging_template.loadbalancer.healthcheck.interval=30s
# - traefik.http.services.staging_template.loadbalancer.healthcheck.timeout=5s
replicas: 1
restart_policy:
condition: on-failure
max_attempts: 3
update_config:
parallelism: 1
delay: 10s
order: start-first
rollback_config:
parallelism: 1
delay: 10s
order: stop-first
networks:
- traefik