Nixius
/
template
Template
2
1
Fork 1
Go to file Use this template
colin 454a54109e Update stack.staging.yml 2025-04-24 10:13:30 -04:00
.cursor Template Project v1.0.0 - Initial setup with Docker configuration 2025-04-23 10:32:30 -04:00
docker/template Template Project v1.0.0 - Initial setup with Docker configuration 2025-04-23 10:32:30 -04:00
temp Template Project v1.0.0 - Initial setup with Docker configuration 2025-04-23 10:32:30 -04:00
tests Template Project v1.0.0 - Initial setup with Docker configuration 2025-04-23 10:32:30 -04:00
.gitignore Template Project v1.0.0 - Initial setup with Docker configuration 2025-04-23 10:32:30 -04:00
.woodpecker.yml base template 2025-03-12 19:16:31 -04:00
README.md Template Project v1.0.0 - Initial setup with Docker configuration 2025-04-23 10:32:30 -04:00
build-test-run.sh Template Project v1.0.0 - Initial setup with Docker configuration 2025-04-23 10:32:30 -04:00
docker-compose.dev.yml Template Project v1.0.0 - Initial setup with Docker configuration 2025-04-23 10:32:30 -04:00
docker-compose.production.yml Template Project v1.0.0 - Initial setup with Docker configuration 2025-04-23 10:32:30 -04:00
docker-compose.staging.yml Template Project v1.0.0 - Initial setup with Docker configuration 2025-04-23 10:32:30 -04:00
docker-compose.test.yml Template Project v1.0.0 - Initial setup with Docker configuration 2025-04-23 10:32:30 -04:00
stack.production.yml Update stack.production.yml 2025-04-24 10:13:02 -04:00
stack.staging.yml Update stack.staging.yml 2025-04-24 10:13:30 -04:00

README.md

Template Project

This is a template project that follows a standardized structure for Docker-based applications.

Project Structure

./
├── .woodpecker.yml          # CI configuration
├── build-test-run.sh        # Convenience script for local development
├── docker/
│   └── template/           # Main application container
│       ├── Dockerfile      # Base Dockerfile
│       ├── Dockerfile.production  # Production-specific Dockerfile
│       └── src/            # Application source code
├── tests/                  # Test scripts
├── 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

Local Development

Quick Start

The easiest way to get started with local development is to use the build-test-run.sh script:

./build-test-run.sh

This script will:

  1. Build the Docker images using docker-compose.dev.yml
  2. Run tests if available
  3. Start all services in the background
  4. Display the URL to access the application

Development Compose File

The docker-compose.dev.yml file is designed for local development. It includes:

  • Volume mounts for code changes without rebuilding
  • Debug environment variables
  • Health checks
  • Local ports for easy access

To use it directly:

# Build and start in one command
docker compose -f docker-compose.dev.yml up --build

# Run in the background
docker compose -f docker-compose.dev.yml up -d

# View logs
docker compose -f docker-compose.dev.yml logs -f

# Stop services
docker compose -f docker-compose.dev.yml down

Using the temp Directory

The ./temp/ directory serves as a scratch space for local testing and development. It's designed to store temporary files that shouldn't be committed to version control, such as:

  • Test output logs (e.g., test_output.log)
  • Temporary build artifacts
  • Local configuration overrides
  • Mock data for testing
  • Debug logs and crash reports

Example Usage

  1. Running tests with output:
# Test output will be written to ./temp/test_output.log
./tests/run_tests.sh > ./temp/test_output.log
  1. Local configuration:
# Create a local config override
cp config.yml ./temp/local_config.yml
# Edit local_config.yml for testing
  1. Debug logs:
# Application debug logs
docker-compose -f docker-compose.test.yml up > ./temp/debug.log

Important Notes

  • The ./temp/ directory is git-ignored
  • Files in this directory are temporary and can be safely deleted
  • Use this directory for any files that shouldn't be committed to version control
  • The directory is mounted in test containers for easy access to test outputs

Development Workflow

  1. Start local development:
./build-test-run.sh
# or
docker compose -f docker-compose.dev.yml up --build
  1. Run tests:
./tests/run_tests.sh
  1. Check test outputs in ./temp/ directory

  2. Clean up temporary files:

rm -rf ./temp/*

CI/CD

The project uses Woodpecker CI for continuous integration. The temp directory is not included in CI builds to ensure clean, reproducible builds.