39 lines
846 B
Docker
39 lines
846 B
Docker
FROM debian:bookworm-slim
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
python3 \
|
|
python3-venv \
|
|
python3-pip \
|
|
gpsbabel \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Set up app directory
|
|
WORKDIR /app
|
|
|
|
# Copy application files
|
|
COPY app.py /app/
|
|
COPY templates /app/templates
|
|
COPY requirements.txt /app/
|
|
|
|
# Create and activate virtual environment
|
|
ENV VIRTUAL_ENV=/opt/venv
|
|
RUN python3 -m venv $VIRTUAL_ENV
|
|
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
|
|
|
# Install Python dependencies in virtual environment
|
|
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Create input and output directories
|
|
RUN mkdir /app/input /app/output
|
|
|
|
# Set environment variables
|
|
ENV FLASK_APP=app.py
|
|
ENV FLASK_RUN_HOST=0.0.0.0
|
|
|
|
# Expose port
|
|
EXPOSE 5000
|
|
|
|
# Run the application
|
|
CMD ["python", "-m", "flask", "run"]
|