-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (28 loc) · 899 Bytes
/
Dockerfile
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
32
33
34
35
36
FROM python:3.11-bullseye
WORKDIR /code
# Add necessary groups and users
RUN groupadd -g 3000 scot4api
RUN useradd -M -r -u 3000 -g 3000 -s /bin/bash scot4api
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
curl \
mariadb-client \
python3-dev \
default-libmysqlclient-dev \
build-essential \
libxml2-dev \
libxslt-dev
# Create the default file storage directories
RUN mkdir -p /var/scot_files/_deleted_items
RUN chown -R scot4api /var/scot_files
# Copy over the required files
COPY requirements.txt /code/requirements.txt
COPY ./src/app /code/app
# Install requirements and upgrade pip
RUN pip install --upgrade pip && pip install -r requirements.txt
# Set deployment user and give correct permissions
RUN chown -R scot4api /code
USER scot4api
# Start option
CMD ["uvicorn", "app.main:app", "--host", "127.0.0.1", "--port", "8000"]