mirror of
https://github.com/tmdinosaurcenter/kiosk-guestbook.git
synced 2025-09-13 11:03:31 -06:00
Making the header/title are a variable
Refactor Dockerfile and entrypoint script; add index.html.template and update example.env
This commit is contained in:
15
Dockerfile
15
Dockerfile
@@ -4,18 +4,25 @@ FROM python:3.9-slim
|
||||
# Set the working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies
|
||||
# Install system dependencies (including gettext for envsubst)
|
||||
RUN apt-get update && apt-get install -y gettext && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Python dependencies
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copy the application code
|
||||
# Copy the application code and template files
|
||||
COPY . .
|
||||
|
||||
# Copy the entrypoint script into the container and make it executable
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
# Set environment variables (can be overridden by .env)
|
||||
ENV FLASK_ENV=production
|
||||
|
||||
# Expose the port (Gunicorn will run on 8000)
|
||||
EXPOSE 8000
|
||||
|
||||
# Run the app with Gunicorn; use 3 workers (can be tuned via .env)
|
||||
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "app:app", "--workers", "3"]
|
||||
# Use the entrypoint script as the container's command
|
||||
CMD ["/entrypoint.sh"]
|
||||
|
Reference in New Issue
Block a user