Skip to content

Commit 7ca9190

Browse files
committed
refactor: improve Docker entrypoint script readability by using multiple echo statements
1 parent 14e0b6e commit 7ca9190

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

Dockerfile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,19 @@ RUN mkdir -p /config/settings \
3030
&& chmod -R 755 /config
3131

3232
# Create a proper entrypoint script to handle initialization
33-
RUN echo '#!/bin/sh\n\
34-
# Ensure config permissions are correct on container restart\nif [ ! -f /config/.initialized ]; then\n echo "Initializing Huntarr config directory..."\n chown -R 1000:1000 /config\n chmod -R 755 /config\n touch /config/.initialized\nfi\n\n# Run the main application\nexec python3 /app/main.py\n' > /app/entrypoint.sh \
35-
&& chmod +x /app/entrypoint.sh
33+
RUN echo '#!/bin/sh' > /app/entrypoint.sh && \
34+
echo '' >> /app/entrypoint.sh && \
35+
echo '# Ensure config permissions are correct on container restart' >> /app/entrypoint.sh && \
36+
echo 'if [ ! -f /config/.initialized ]; then' >> /app/entrypoint.sh && \
37+
echo ' echo "Initializing Huntarr config directory..."' >> /app/entrypoint.sh && \
38+
echo ' chown -R 1000:1000 /config' >> /app/entrypoint.sh && \
39+
echo ' chmod -R 755 /config' >> /app/entrypoint.sh && \
40+
echo ' touch /config/.initialized' >> /app/entrypoint.sh && \
41+
echo 'fi' >> /app/entrypoint.sh && \
42+
echo '' >> /app/entrypoint.sh && \
43+
echo '# Run the main application' >> /app/entrypoint.sh && \
44+
echo 'exec python3 /app/main.py' >> /app/entrypoint.sh && \
45+
chmod +x /app/entrypoint.sh
3646

3747
# Set environment variables
3848
ENV PYTHONPATH=/app

0 commit comments

Comments
 (0)