mirror of
https://github.com/Rainyy21/URL_shortener.git
synced 2026-10-10 23:40:14 -04:00
added docker and modify the file so it work
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
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"]
|
||||
Reference in New Issue
Block a user