-
-
Notifications
You must be signed in to change notification settings - Fork 173
/
Dockerfile
45 lines (34 loc) · 832 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
37
38
39
40
41
42
43
44
FROM python:3.11.4-alpine
RUN apk add --no-cache \
curl \
# For building dependencies. \
gcc \
musl-dev \
git \
g++ \
libffi-dev \
# For psycopg \
postgresql-dev \
# For mysql deps \
mariadb-dev \
# For UI \
ncurses \
bash
RUN adduser --disabled-password fastapi_template
RUN mkdir /projects /src
RUN chown -R fastapi_template:fastapi_template /projects /src
USER fastapi_template
WORKDIR /src
ENV PATH ${PATH}:/home/fastapi_template/.local/bin
RUN pip install poetry==1.5.1
COPY . /src/
RUN pip install .
USER root
RUN rm -rfv /src
RUN apk del curl
USER fastapi_template
RUN git config --global user.name "Fastapi Template"
RUN git config --global user.email "fastapi-template@no-reply.com"
VOLUME /projects
WORKDIR /projects
ENTRYPOINT ["/home/fastapi_template/.local/bin/fastapi_template"]