-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (22 loc) · 878 Bytes
/
Dockerfile
File metadata and controls
29 lines (22 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Use the official Python image as the base image
FROM python:3.13-slim
# Set the working directory in the container
WORKDIR /boilerplate
# Copy the application files into the container
COPY . /boilerplate
# Create folders and position files correctly
RUN mkdir -p /logs
RUN touch app/core/db/database.db
RUN cp app/conf/config_docker.ini app/conf/config.ini
# Install uv (package manager) and system dependencies
RUN pip install --no-cache-dir uv
RUN apt-get update
# These system packages are necessary per the mysqlclient python package documentation
RUN apt-get install default-libmysqlclient-dev build-essential pkg-config -y
RUN uv sync
# Ensure the database configuration is correct and initialize the database
RUN uv run app/utils/initDB.py
# Expose the port the app runs on
EXPOSE 8000
# Command to run the FastAPI application
CMD ["uv", "run", "fastapi", "run"]