more podman fixes
This commit is contained in:
@@ -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 }}
|
|
||||||
@@ -39,13 +39,12 @@ COPY app/web/ ./web/
|
|||||||
COPY app/migrations/ ./migrations/
|
COPY app/migrations/ ./migrations/
|
||||||
COPY app/alembic.ini .
|
COPY app/alembic.ini .
|
||||||
COPY app/init_db.py .
|
COPY app/init_db.py .
|
||||||
COPY app/docker-entrypoint.sh /docker-entrypoint.sh
|
|
||||||
|
|
||||||
# Create required directories
|
# Create required directories
|
||||||
RUN mkdir -p /app/output /app/logs
|
RUN mkdir -p /app/output /app/logs
|
||||||
|
|
||||||
# Make scripts executable
|
# 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
|
# Force Python unbuffered output
|
||||||
ENV PYTHONUNBUFFERED=1
|
ENV PYTHONUNBUFFERED=1
|
||||||
|
|||||||
@@ -2,11 +2,10 @@ version: '3.8'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
web:
|
web:
|
||||||
image: git.sneakygeek.net/sneakygeek/sneakyscan:master
|
build: .
|
||||||
container_name: sneakyscanner-web
|
container_name: sneakyscanner-web
|
||||||
# Use entrypoint script that auto-initializes database on first run
|
working_dir: /app
|
||||||
entrypoint: ["/docker-entrypoint.sh"]
|
entrypoint: ["python3", "-u", "-m", "web.app"]
|
||||||
command: ["python3", "-u", "-m", "web.app"]
|
|
||||||
# Note: Using host network mode for scanner capabilities, so no port mapping needed
|
# Note: Using host network mode for scanner capabilities, so no port mapping needed
|
||||||
# The Flask app will be accessible at http://localhost:5000
|
# The Flask app will be accessible at http://localhost:5000
|
||||||
volumes:
|
volumes:
|
||||||
@@ -58,7 +57,7 @@ services:
|
|||||||
# Optional: Initialize database on first run
|
# Optional: Initialize database on first run
|
||||||
# Run with: docker-compose -f docker-compose-web.yml run --rm init-db
|
# Run with: docker-compose -f docker-compose-web.yml run --rm init-db
|
||||||
init-db:
|
init-db:
|
||||||
image: git.sneakygeek.net/sneakygeek/sneakyscan:master
|
build: .
|
||||||
container_name: sneakyscanner-init-db
|
container_name: sneakyscanner-init-db
|
||||||
entrypoint: ["python3"]
|
entrypoint: ["python3"]
|
||||||
command: ["init_db.py", "--db-url", "sqlite:////app/data/sneakyscanner.db"]
|
command: ["init_db.py", "--db-url", "sqlite:////app/data/sneakyscanner.db"]
|
||||||
|
|||||||
31
setup.sh
31
setup.sh
@@ -91,27 +91,24 @@ echo "Creating required directories..."
|
|||||||
mkdir -p data logs output configs
|
mkdir -p data logs output configs
|
||||||
echo "✓ Directories created"
|
echo "✓ Directories created"
|
||||||
|
|
||||||
# Check if Docker is running
|
# Check if Podman is running
|
||||||
echo ""
|
echo ""
|
||||||
echo "Checking Docker..."
|
echo "Checking Podman..."
|
||||||
if ! docker info > /dev/null 2>&1; then
|
if ! podman info > /dev/null 2>&1; then
|
||||||
echo "✗ Docker is not running or not installed"
|
echo "✗ Podman is not running or not installed"
|
||||||
echo "Please install Docker and start the Docker daemon"
|
echo "Please install Podman"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "✓ Docker is running"
|
echo "✓ Podman is available"
|
||||||
|
|
||||||
# Build and start
|
# Build and start
|
||||||
echo ""
|
echo ""
|
||||||
echo "Building and starting SneakyScanner..."
|
echo "Starting SneakyScanner..."
|
||||||
echo "This may take a few minutes on first run..."
|
echo "This may take a few minutes on first run..."
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
docker compose build
|
podman-compose build
|
||||||
|
podman-compose up -d
|
||||||
echo ""
|
|
||||||
echo "Starting SneakyScanner..."
|
|
||||||
docker compose up -d
|
|
||||||
|
|
||||||
# Wait for service to be healthy
|
# Wait for service to be healthy
|
||||||
echo ""
|
echo ""
|
||||||
@@ -119,7 +116,7 @@ echo "Waiting for application to start..."
|
|||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
# Check if container is running
|
# Check if container is running
|
||||||
if docker ps | grep -q sneakyscanner-web; then
|
if podman ps | grep -q sneakyscanner-web; then
|
||||||
echo ""
|
echo ""
|
||||||
echo "================================================"
|
echo "================================================"
|
||||||
echo " ✓ SneakyScanner is Running!"
|
echo " ✓ SneakyScanner is Running!"
|
||||||
@@ -140,15 +137,15 @@ if docker ps | grep -q sneakyscanner-web; then
|
|||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
echo "Useful commands:"
|
echo "Useful commands:"
|
||||||
echo " docker compose logs -f # View logs"
|
echo " podman-compose logs -f # View logs"
|
||||||
echo " docker compose stop # Stop the service"
|
echo " podman-compose stop # Stop the service"
|
||||||
echo " docker compose restart # Restart the service"
|
echo " podman-compose restart # Restart the service"
|
||||||
echo ""
|
echo ""
|
||||||
echo "⚠ IMPORTANT: Change your password after first login!"
|
echo "⚠ IMPORTANT: Change your password after first login!"
|
||||||
echo "================================================"
|
echo "================================================"
|
||||||
else
|
else
|
||||||
echo ""
|
echo ""
|
||||||
echo "✗ Container failed to start. Check logs with:"
|
echo "✗ Container failed to start. Check logs with:"
|
||||||
echo " docker compose logs"
|
echo " podman-compose logs"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user