-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (26 loc) · 971 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
FROM python:3.8-alpine as builder
ENV APP_HOME /usr/src/hikage_finder
WORKDIR ${APP_HOME}
RUN pip install pipenv
COPY Pipfile Pipfile.lock ./
RUN pipenv lock -r > requirements.txt
FROM python:3.8-alpine
ENV APP_HOME /usr/src/hikage_finder
ENV DOCKERIZE_VERSION v0.6.1
WORKDIR ${APP_HOME}
COPY --from=builder ${APP_HOME}/requirements.txt ./
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz
RUN apk add --no-cache --virtual build-deps \
gcc \
make \
musl-dev \
&& apk add --no-cache --virtual run-deps \
postgresql-dev \
&& pip install -r requirements.txt \
&& apk del --purge build-deps
COPY ./src ./src
WORKDIR ${APP_HOME}/src
EXPOSE 8000
CMD [ "uvicorn", "main:app", "--host", "0.0.0.0" ]