mirror of
https://github.com/Rainyy21/URL_shortener.git
synced 2026-10-10 23:40:14 -04:00
21 lines
474 B
Docker
21 lines
474 B
Docker
FROM python:3.11-slim
|
|
|
|
# Set the working directory
|
|
WORKDIR /app
|
|
|
|
# Copy the requirements file and install dependencies
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy the rest of the application code
|
|
COPY . .
|
|
|
|
# Ensure the database directory exists for SQLite persistence
|
|
RUN mkdir -p /app/db
|
|
|
|
# Expose the application port
|
|
EXPOSE 8000
|
|
|
|
# Command to start the application
|
|
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|