forked from s3rius/FastAPI-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (29 loc) · 692 Bytes
/
Dockerfile
File metadata and controls
39 lines (29 loc) · 692 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
32
33
34
35
36
37
38
FROM python:3.9.7-alpine3.13
RUN apk add --no-cache \
curl \
# For building dependencies. \
gcc \
musl-dev \
git \
g++ \
libffi-dev \
# For psycopg \
postgresql-dev \
# For mysql deps \
mariadb-connector-c-dev
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.2.2
COPY . /src/
RUN pip install .
USER root
RUN rm -rfv /src
RUN apk del curl
USER fastapi_template
VOLUME /projects
WORKDIR /projects
ENTRYPOINT ["/home/fastapi_template/.local/bin/fastapi_template"]