diff --git a/Dockerfile b/Dockerfile index d1e521a..28b15cd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,9 +19,10 @@ COPY *config.json ./ # Create output directories RUN mkdir -p /app/snapshots /app/logs -# Copy scheduler script +# Copy scripts COPY scheduler.sh ./ -RUN chmod +x scheduler.sh +COPY startup.sh ./ +RUN chmod +x scheduler.sh startup.sh # Copy cron configuration COPY crontab /etc/cron.d/parentzone-downloader @@ -35,8 +36,11 @@ RUN touch /var/log/cron.log ENV PYTHONUNBUFFERED=1 ENV PYTHONPATH=/app +# Expose port for web server +EXPOSE 8080 + # Expose volume for persistent data VOLUME ["/app/snapshots", "/app/logs", "/app/parentzone_images"] -# Start cron and keep container running -CMD ["sh", "-c", "cron && tail -f /var/log/cron.log"] +# Start all services using startup script +CMD ["./startup.sh"] diff --git a/docker-compose.yml b/docker-compose.yml index 99ad750..96ebc2b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: '3.8' +version: "3.8" services: parentzone-downloader: @@ -18,10 +18,9 @@ services: - ./logs:/app/logs # Mount your config file - ./config.json:/app/config.json:ro + ports: + - "8080:8080" restart: unless-stopped - # Optional: expose a port if you want to add a web interface later - # ports: - # - "8080:8080" volumes: snapshots: