v1.3 - Slimmer docker image + fifo file check #7
							
								
								
									
										27
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								Dockerfile
									
									
									
									
									
								
							@@ -1,42 +1,19 @@
 | 
			
		||||
FROM python:3.11-alpine
 | 
			
		||||
 | 
			
		||||
RUN apk add --no-cache --virtual .build-deps \
 | 
			
		||||
    build-base \
 | 
			
		||||
    jpeg-dev \
 | 
			
		||||
    zlib-dev \
 | 
			
		||||
    libffi-dev \
 | 
			
		||||
    musl-dev \
 | 
			
		||||
    && apk add --no-cache \
 | 
			
		||||
    jpeg \
 | 
			
		||||
    zlib \
 | 
			
		||||
    libwebp \
 | 
			
		||||
    bash
 | 
			
		||||
FROM python:3.11-slim
 | 
			
		||||
 | 
			
		||||
WORKDIR /app
 | 
			
		||||
 | 
			
		||||
COPY requirements.txt .
 | 
			
		||||
 | 
			
		||||
RUN pip install --no-cache-dir -r requirements.txt \
 | 
			
		||||
    && apk del .build-deps
 | 
			
		||||
RUN pip install --no-cache-dir -r requirements.txt
 | 
			
		||||
 | 
			
		||||
RUN rm -rf /var/cache/apk/*
 | 
			
		||||
 | 
			
		||||
# Copy source code and scripts
 | 
			
		||||
COPY ./src/ ./src/
 | 
			
		||||
COPY ./build.py ./build.py
 | 
			
		||||
COPY ./gallery.py ./gallery.py
 | 
			
		||||
 | 
			
		||||
# Copy default config
 | 
			
		||||
COPY ./config /app/default
 | 
			
		||||
 | 
			
		||||
# Copy entrypoint and make executable
 | 
			
		||||
COPY ./docker/.sh/entrypoint.sh /app/entrypoint.sh
 | 
			
		||||
RUN chmod +x /app/entrypoint.sh
 | 
			
		||||
 | 
			
		||||
# Add wrapper scripts for convenience commands
 | 
			
		||||
RUN printf '#!/bin/sh\n/app/entrypoint.sh build\n' > /usr/local/bin/build && chmod +x /usr/local/bin/build && \
 | 
			
		||||
    printf '#!/bin/sh\n/app/entrypoint.sh gallery\n' > /usr/local/bin/gallery && chmod +x /usr/local/bin/gallery
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
ENTRYPOINT ["/app/entrypoint.sh"]
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -19,7 +19,7 @@ copy_default_config() {
 | 
			
		||||
 | 
			
		||||
    if [ ! -e "$target" ]; then
 | 
			
		||||
      echo "Copying default config file: $filename"
 | 
			
		||||
      cp "$file" "$target"
 | 
			
		||||
      cp -r "$file" "$target"
 | 
			
		||||
      files_copied=true
 | 
			
		||||
    fi
 | 
			
		||||
  done
 | 
			
		||||
@@ -33,10 +33,16 @@ copy_default_config() {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
start_server() {
 | 
			
		||||
  # Clean up old FIFOs
 | 
			
		||||
  [ -p /tmp/build_logs_fifo ] && rm /tmp/build_logs_fifo
 | 
			
		||||
  [ -p /tmp/build_logs_fifo2 ] && rm /tmp/build_logs_fifo2
 | 
			
		||||
 | 
			
		||||
  mkfifo /tmp/build_logs_fifo
 | 
			
		||||
  mkfifo /tmp/build_logs_fifo2
 | 
			
		||||
 | 
			
		||||
  cat /tmp/build_logs_fifo >&2 &
 | 
			
		||||
  cat /tmp/build_logs_fifo2 >&2 &
 | 
			
		||||
 | 
			
		||||
  echo "Starting HTTP server on port 3000..."
 | 
			
		||||
  python3 -u -m http.server 3000 -d /app/output &
 | 
			
		||||
  SERVER_PID=$!
 | 
			
		||||
@@ -44,7 +50,6 @@ start_server() {
 | 
			
		||||
  wait $SERVER_PID
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if [ $# -eq 0 ]; then
 | 
			
		||||
  echo -e "${CYAN}╭───────────────────────────────────────────╮${NC}"
 | 
			
		||||
  echo -e "${CYAN}│${NC}            Lum${CYAN}eex${NC} - Version 1.3${NC}           ${CYAN}│${NC}"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user