more podman fixes

This commit is contained in:
2025-12-23 19:25:36 -06:00
parent 136276497d
commit 8c34f8b2eb
4 changed files with 19 additions and 57 deletions

View File

@@ -1,33 +0,0 @@
name: Build and Push Docker Image
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
# required to ensure we have node and all the build requirements for gitea actions
container: docker.io/catthehacker/ubuntu:act-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: git.sneakygeek.net
username: ${{ github.actor }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
git.sneakygeek.net/sneakygeek/sneakymon:latest
git.sneakygeek.net/sneakygeek/sneakymon:${{ github.sha }}

View File

@@ -39,13 +39,12 @@ COPY app/web/ ./web/
COPY app/migrations/ ./migrations/
COPY app/alembic.ini .
COPY app/init_db.py .
COPY app/docker-entrypoint.sh /docker-entrypoint.sh
# Create required directories
RUN mkdir -p /app/output /app/logs
# Make scripts executable
RUN chmod +x /app/src/scanner.py /app/init_db.py /docker-entrypoint.sh
RUN chmod +x /app/src/scanner.py /app/init_db.py
# Force Python unbuffered output
ENV PYTHONUNBUFFERED=1

View File

@@ -2,11 +2,10 @@ version: '3.8'
services:
web:
image: git.sneakygeek.net/sneakygeek/sneakyscan:master
build: .
container_name: sneakyscanner-web
# Use entrypoint script that auto-initializes database on first run
entrypoint: ["/docker-entrypoint.sh"]
command: ["python3", "-u", "-m", "web.app"]
working_dir: /app
entrypoint: ["python3", "-u", "-m", "web.app"]
# Note: Using host network mode for scanner capabilities, so no port mapping needed
# The Flask app will be accessible at http://localhost:5000
volumes:
@@ -58,7 +57,7 @@ services:
# Optional: Initialize database on first run
# Run with: docker-compose -f docker-compose-web.yml run --rm init-db
init-db:
image: git.sneakygeek.net/sneakygeek/sneakyscan:master
build: .
container_name: sneakyscanner-init-db
entrypoint: ["python3"]
command: ["init_db.py", "--db-url", "sqlite:////app/data/sneakyscanner.db"]

View File

@@ -91,27 +91,24 @@ echo "Creating required directories..."
mkdir -p data logs output configs
echo "✓ Directories created"
# Check if Docker is running
# Check if Podman is running
echo ""
echo "Checking Docker..."
if ! docker info > /dev/null 2>&1; then
echo "✗ Docker is not running or not installed"
echo "Please install Docker and start the Docker daemon"
echo "Checking Podman..."
if ! podman info > /dev/null 2>&1; then
echo "✗ Podman is not running or not installed"
echo "Please install Podman"
exit 1
fi
echo "✓ Docker is running"
echo "✓ Podman is available"
# Build and start
echo ""
echo "Building and starting SneakyScanner..."
echo "Starting SneakyScanner..."
echo "This may take a few minutes on first run..."
echo ""
docker compose build
echo ""
echo "Starting SneakyScanner..."
docker compose up -d
podman-compose build
podman-compose up -d
# Wait for service to be healthy
echo ""
@@ -119,7 +116,7 @@ echo "Waiting for application to start..."
sleep 5
# Check if container is running
if docker ps | grep -q sneakyscanner-web; then
if podman ps | grep -q sneakyscanner-web; then
echo ""
echo "================================================"
echo " ✓ SneakyScanner is Running!"
@@ -140,15 +137,15 @@ if docker ps | grep -q sneakyscanner-web; then
fi
echo ""
echo "Useful commands:"
echo " docker compose logs -f # View logs"
echo " docker compose stop # Stop the service"
echo " docker compose restart # Restart the service"
echo " podman-compose logs -f # View logs"
echo " podman-compose stop # Stop the service"
echo " podman-compose restart # Restart the service"
echo ""
echo "⚠ IMPORTANT: Change your password after first login!"
echo "================================================"
else
echo ""
echo "✗ Container failed to start. Check logs with:"
echo " docker compose logs"
echo " podman-compose logs"
exit 1
fi