-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
66 lines (55 loc) · 1.86 KB
/
Dockerfile
File metadata and controls
66 lines (55 loc) · 1.86 KB
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
58
59
60
61
62
63
64
65
66
# Bad Apple ASCII Player - Official HAProxy Docker Image
FROM haproxytech/haproxy-ubuntu:3.2
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
# Switch to root to install additional packages
USER root
# Install additional dependencies for our ASCII player
RUN apt-get update && apt-get install -y \
# Lua development (if not already included)
lua5.4 \
liblua5.4-dev \
# Network tools
socat \
curl \
# Python and video processing
python3 \
python3-pip \
python3-opencv \
python3-numpy \
ffmpeg \
# Cleanup
&& rm -rf /var/lib/apt/lists/*
# Create necessary directories with proper permissions
RUN mkdir -p /usr/local/etc/haproxy \
/var/lib/haproxy \
/var/run/haproxy \
/app/frames \
&& chown -R haproxy:haproxy /var/lib/haproxy /var/run/haproxy /app /usr/local/etc/haproxy \
&& chmod -R 775 /app
# Copy application files
COPY video_converter.py /app/
COPY bad_apple.lua /usr/local/etc/haproxy/
COPY haproxy.cfg /usr/local/etc/haproxy/
COPY start.sh /app/
# Make the script executable and ensure proper ownership
RUN chmod +x /app/start.sh \
&& chown -R haproxy:haproxy /app /usr/local/etc/haproxy \
&& chmod -R 775 /app
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8999/health || exit 1
# Expose ports
EXPOSE 8080 8888 8404 8999
# Set working directory
WORKDIR /app
# Default command (start as root, then switch to haproxy user for HAProxy)
CMD ["/app/start.sh"]
# Add labels for metadata
LABEL maintainer="Bad Apple HAProxy Player" \
version="1.0" \
description="Interactive ASCII video player using HAProxy + Lua" \
ports.web="8080" \
ports.tcp="8888" \
ports.stats="8404" \
ports.health="8999"