-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (23 loc) · 825 Bytes
/
Dockerfile
File metadata and controls
31 lines (23 loc) · 825 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
30
31
# Use an official Python image
FROM python:3.12-slim
# Metadata
LABEL maintainer="Harry Levesque <harrylevesque17@gmail.com>"
LABEL description="SAMFpy Server Docker container"
# Set working directory
WORKDIR /app
# Install git for cloning the repo
RUN apt-get update && \
apt-get install -y git && \
rm -rf /var/lib/apt/lists/*
# Environment variables
ENV PORT=8189
ENV PYTHONUNBUFFERED=1
# Clone the repo and checkout main branch
RUN git clone -b main https://github.com/Harrylevesque/SAMFpy-Server.git .
# Install Python dependencies
RUN python -m venv venv
RUN . venv/bin/activate && pip install --upgrade pip && pip install -r requirements.txt
# Expose port
EXPOSE $PORT
# Entrypoint to start the server
CMD ["/bin/bash", "-c", ". venv/bin/activate && exec uvicorn main:app --host 0.0.0.0 --port $PORT"]