diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 1157fc9..6f340cd 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -5,22 +5,9 @@ services: context: ./docker/template dockerfile: Dockerfile image: template:dev - ports: - - "3000:3000" volumes: - - ./docker/template/src:/app/src - - ./temp:/app/temp - environment: - - NODE_ENV=development - - DEBUG=true - - LOG_LEVEL=debug - restart: unless-stopped - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:3000/health"] - interval: 30s - timeout: 5s - retries: 3 - start_period: 10s + - ./docker/template/src:/scratch + - ./temp:/temp networks: - dev_network diff --git a/docker-compose.test.yml b/docker-compose.test.yml new file mode 100644 index 0000000..fba6d69 --- /dev/null +++ b/docker-compose.test.yml @@ -0,0 +1,12 @@ +# Test configuration +services: + template: + build: + context: ./docker/template + dockerfile: Dockerfile + image: template:test + volumes: + - ./docker/template/src:/scratch + - ./temp:/temp + # Since scratch can't run commands, we use a dummy entrypoint + entrypoint: "true" \ No newline at end of file diff --git a/docker/template/Dockerfile b/docker/template/Dockerfile new file mode 100644 index 0000000..55a0f12 --- /dev/null +++ b/docker/template/Dockerfile @@ -0,0 +1,10 @@ +FROM alpine:3.18 + +# Create directories for volume mounts +RUN mkdir -p /scratch /temp + +# Set working directory +WORKDIR /scratch + +# Simple command to keep container running +CMD ["tail", "-f", "/dev/null"] diff --git a/docker/template/Dockerfile.production b/docker/template/Dockerfile.production new file mode 100644 index 0000000..35a86f7 --- /dev/null +++ b/docker/template/Dockerfile.production @@ -0,0 +1 @@ +FROM git.nixc.us/nixius/template:staging diff --git a/tests/run_tests.sh b/tests/run_tests.sh new file mode 100755 index 0000000..169ab4f --- /dev/null +++ b/tests/run_tests.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Create temp directory if it doesn't exist +mkdir -p ./temp + +# Run tests and capture output +echo "Running tests..." +echo "Test started at $(date)" > ./temp/test_output.log + +# Example test commands +echo "Testing Docker build..." >> ./temp/test_output.log +docker compose -f docker-compose.test.yml build >> ./temp/test_output.log 2>&1 + +echo "Testing container startup..." >> ./temp/test_output.log +docker compose -f docker-compose.test.yml up -d >> ./temp/test_output.log 2>&1 + +# Wait for container to be ready +sleep 5 + +# Check container status +echo "Container status:" >> ./temp/test_output.log +docker compose -f docker-compose.test.yml ps >> ./temp/test_output.log 2>&1 + +# Clean up +echo "Cleaning up..." >> ./temp/test_output.log +docker compose -f docker-compose.test.yml down >> ./temp/test_output.log 2>&1 + +echo "Tests completed at $(date)" >> ./temp/test_output.log + +# Display results +echo "Test results have been saved to ./temp/test_output.log" +cat ./temp/test_output.log \ No newline at end of file