-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile.prod.old
52 lines (32 loc) · 1005 Bytes
/
Dockerfile.prod.old
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
45
46
47
48
49
50
51
52
FROM python:3.10.5 as builder
WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# RUN apt-get update
# RUN apt-get upgrade -y && apt-get -y install postgresql gcc python3-dev musl-dev
RUN pip install --upgrade pip
COPY . .
RUN pip wheel --no-cache-dir --no-deps --wheel-dir /app/wheels -r requirements.txt
FROM python:3.10.5
RUN mkdir -p /home/app
RUN groupadd app
RUN useradd -m -g app app -p PASSWORD
RUN usermod -aG app app
ENV HOME=/home/app
ENV APP_HOME=/home/app/web
RUN mkdir $APP_HOME
#RUN mkdir $APP_HOME/staticfiles
WORKDIR $APP_HOME
RUN apt-get update \
&& apt-get install -y netcat
COPY --from=builder /app/wheels /wheels
COPY --from=builder /app/requirements.txt .
RUN pip install --no-cache /wheels/*
#COPY ./entrypoint.prod.sh $APP_HOME
COPY entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["entrypoint.sh"]
COPY . $APP_HOME
RUN chown -R app:app $APP_HOME
USER app
# ENTRYPOINT ["/home/app/web/entrypoint.prod.sh"]