Robohash/Dockerfile
e1ven 3b9066850a Update Robohash for PyPI republishing
Some users have asked for an updated version in PyPI, so I'm doing some minor cleanup.
No real functionality changes, just modernizing things that would be considered more
standard 10+ years after this code was written.

- Added note about maintenance mode in README
- Cleaned up Python 3 compatibility (removed Python 2 support)
- Added minimal test for image consistency
- Added Docker image + GitHub workflow to build/publish it
- Fixed some minor bugs and improved error handling
- Added better CLI help text

The project is now officially in maintenance mode as noted in the README.
2025-03-15 16:30:01 -04:00

34 lines
825 B
Docker

FROM debian:12-slim
# Set environment variables
ENV PORT=8080
ENV PYTHONUNBUFFERED=1
# Install system dependencies in a single layer to reduce image size
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
python3-pillow \
python3-tornado \
python3-natsort \
--no-install-recommends && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy the application code
COPY robohash/ /app/robohash/
COPY setup.py .
COPY README.md .
# Install the application in development mode
# Use the --break-system-packages flag since this is a controlled environment
RUN pip3 install -e . --break-system-packages
# Expose the port that the application will run on
EXPOSE 8080
# Command to run the application
CMD ["python3", "-m", "robohash.webfront"]