34 lines
1.1 KiB
Docker
34 lines
1.1 KiB
Docker
# Dockerfile for bash script generator FastAPI app
|
|
FROM python:3.11-slim
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy requirements first for better layer caching
|
|
COPY bashgen/requirements.txt .
|
|
|
|
# Install Python dependencies
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy application code
|
|
COPY bashgen/app.py .
|
|
COPY bashgen/templates/ ./templates/
|
|
|
|
# Copy banner markdown files
|
|
# Use templates directory as source, copy to workingscope in container
|
|
COPY bashgen/templates/loginbanner.md.template bashgen/templates/loginbanner_dod_cmmc.md.template bashgen/templates/postloginbanner.md.template /tmp/
|
|
RUN mkdir -p /app/workingscope && \
|
|
cp /tmp/loginbanner.md.template /app/workingscope/loginbanner.md && \
|
|
cp /tmp/loginbanner_dod_cmmc.md.template /app/workingscope/loginbanner_dod_cmmc.md && \
|
|
cp /tmp/postloginbanner.md.template /app/workingscope/postloginbanner.md
|
|
|
|
# Expose port
|
|
EXPOSE 8080
|
|
|
|
# Run the application
|
|
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8080"]
|