File size: 1,971 Bytes
a490ff5
84e5172
 
 
 
 
 
 
a490ff5
84e5172
0cee562
84e5172
 
 
 
 
 
 
0cee562
 
 
 
 
 
4455913
 
 
 
 
 
 
 
 
aa83347
 
 
 
6e13324
aa83347
15d23da
 
5e73e67
990ea61
5e73e67
15d23da
947dd17
02246ee
947dd17
a490ff5
 
d82024c
a490ff5
 
 
5e73e67
15d23da
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
FROM python:3.11-slim
# Install dependencies
RUN apt update && apt install -y \
    gcc \
    curl \
    sudo \
    git-lfs \
    openssl \
    jq \
    && rm -rf /var/lib/apt/lists/*

# Install Python packages
RUN pip install --no-cache-dir \
    huggingface_hub \
    datasets
    
    
    
# Add health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
  CMD curl -f http://localhost:7860/ || exit 1
  
COPY config.toml /app/readeck/config.toml

# --- ADD THIS LINE TO FIX PERMISSION ISSUES ---
# This command changes the file permissions to be readable and writable by everyone.
# This is a common fix for permission denied errors, especially if the application
# needs to write to the config file or if the user running the app is unknown.
# If config.toml is only read by the application, 'chmod 644' might be sufficient and more secure.
# However, for debugging and ensuring it runs, '666' is a good start.
RUN chmod 666 /app/readeck/config.toml


# --- NEW ADDITION FOR DATA DIRECTORY PERMISSIONS ---
# Create the 'data' directory and set permissions to allow writing by any user.
# This ensures the application, even if running as a non-root user,
# can create and write files (like db.sqlite3) within this directory.
#RUN mkdir -p /app/readeck/data && chmod 777 /app/readeck/data

# Copy sync scripts
COPY sync_storage.py /app/sync_storage.py
COPY start_with_sync.sh /start.sh
# Make scripts executable
RUN chmod +x /app/sync_storage.py /start.sh
# Start with sync
# Set working directory
WORKDIR /tmp

RUN readeck_url=$(curl -X 'GET' 'https://codeberg.org/api/v1/repos/readeck/readeck/releases/latest' -H 'accept: application/json' | jq -r '.assets[] | .browser_download_url | select(. | endswith("linux-amd64"))') && \
echo download readeck from $readeck_url && \ 
curl -q $readeck_url -o /bin/readeck &&\
chmod a+x /bin/readeck
  

ENTRYPOINT ["/start.sh"]
# CMD ["/bin/readeck","serve", "-config", "/app/readeck/config.toml"]