diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..60be610 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,7 @@ +# Enforce LF endings for executable scripts to avoid /usr/bin/env CRLF issues +*.sh text eol=lf +*.py text eol=lf + +# Optional: keep everything else automatic +* text=auto + diff --git a/Dockerfile b/Dockerfile index 07d1d9d..2921229 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,8 @@ ENV FLASK_ENV=production RUN apt-get update && apt-get install -y \ curl \ tzdata \ + bash \ + dos2unix \ # Network tools for debugging iproute2 \ net-tools \ @@ -51,8 +53,13 @@ RUN mkdir -p /app/app/static/uploads/logos /app/static/uploads/logos && \ # Copy the startup script and ensure it's executable COPY docker/start-fixed.py /app/start.py -# Make startup scripts executable -RUN chmod +x /app/start.py /app/docker/init-database.py /app/docker/init-database-sql.py /app/docker/init-database-enhanced.py /app/docker/verify-database.py /app/docker/test-db.py /app/docker/test-routing.py /app/docker/entrypoint.sh /app/docker/entrypoint_fixed.sh /app/docker/startup_with_migration.py /app/docker/test_db_connection.py /app/docker/debug_startup.sh /app/docker/simple_test.sh +# Fix line endings for the startup and entrypoint scripts +RUN dos2unix /app/start.py /app/docker/entrypoint_fixed.sh /app/docker/entrypoint.sh /app/docker/entrypoint_simple.sh 2>/dev/null || true + +# Make startup scripts executable and ensure proper line endings +RUN chmod +x /app/start.py /app/docker/init-database.py /app/docker/init-database-sql.py /app/docker/init-database-enhanced.py /app/docker/verify-database.py /app/docker/test-db.py /app/docker/test-routing.py /app/docker/entrypoint.sh /app/docker/entrypoint_fixed.sh /app/docker/entrypoint_simple.sh /app/docker/entrypoint.py /app/docker/startup_with_migration.py /app/docker/test_db_connection.py /app/docker/debug_startup.sh /app/docker/simple_test.sh && \ + ls -la /app/docker/entrypoint.py && \ + head -5 /app/docker/entrypoint.py # Create non-root user RUN useradd -m -u 1000 timetracker && \ @@ -62,6 +69,10 @@ RUN useradd -m -u 1000 timetracker && \ RUN ls -la /app/start.py && \ head -1 /app/start.py +# Verify entrypoint script exists and is accessible +RUN ls -la /app/docker/entrypoint.py && \ + head -1 /app/docker/entrypoint.py + USER timetracker # Expose port @@ -71,8 +82,8 @@ EXPOSE 8080 HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \ CMD curl -f http://localhost:8080/_health || exit 1 -# Set the entrypoint +# Set the entrypoint back to the fixed shell script ENTRYPOINT ["/app/docker/entrypoint_fixed.sh"] -# Run the application +# Run the application via python to avoid shebang/CRLF issues CMD ["python", "/app/start.py"] diff --git a/README.md b/README.md index cd5bf50..311c246 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,6 @@ A comprehensive web-based time tracking application built with Flask, featuring
-
TimeTracker by DryTrix
+Use the CSV export feature to download time entries for use in external tools like Excel or accounting software.
+Use the CSV export feature to download time entries for external tools. Find it on the Reports page.
Set up a new project to organize your work and track time effectively
+