mirror of
https://github.com/sstent/GarminSync.git
synced 2026-01-25 16:42:20 +00:00
working again stable
This commit is contained in:
39
Dockerfile
39
Dockerfile
@@ -1,38 +1,39 @@
|
||||
# Use official Python base image
|
||||
# Use an official Python runtime as a parent image
|
||||
FROM python:3.10-slim
|
||||
|
||||
# Set environment variables
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
# Set work directory
|
||||
# Set the working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
build-essential curl git \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy and install Python dependencies
|
||||
# Copy requirements file first to leverage Docker cache
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir --upgrade pip && \
|
||||
pip install --no-cache-dir -r requirements.txt && \
|
||||
pip install --no-cache-dir alembic
|
||||
|
||||
# Upgrade pip and install Python dependencies
|
||||
RUN pip install --upgrade pip && \
|
||||
pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copy application code
|
||||
COPY garminsync/ ./garminsync/
|
||||
COPY migrations/ ./migrations/
|
||||
COPY tests/ ./tests/
|
||||
COPY entrypoint.sh .
|
||||
COPY patches/ ./patches/
|
||||
|
||||
# Fix garth package duplicate parameter issue
|
||||
RUN cp patches/garth_data_weight.py /usr/local/lib/python3.10/site-packages/garth/data/weight.py
|
||||
|
||||
# Make the entrypoint script executable
|
||||
RUN chmod +x entrypoint.sh
|
||||
|
||||
# Create data directory
|
||||
RUN mkdir -p /app/data
|
||||
# Set environment variables from .env file
|
||||
ENV ENV_FILE=/app/.env
|
||||
ENV DATA_DIR=/app/data
|
||||
|
||||
# Expose web UI port
|
||||
EXPOSE 8080
|
||||
|
||||
# Update entrypoint to support daemon mode
|
||||
# Set the entrypoint
|
||||
ENTRYPOINT ["./entrypoint.sh"]
|
||||
CMD ["--help"]
|
||||
|
||||
# Expose port
|
||||
EXPOSE 8888
|
||||
|
||||
Reference in New Issue
Block a user