-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
35 lines (29 loc) · 1.04 KB
/
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
FROM python:3.8-alpine
ENV PATH="/scripts:${PATH}"
COPY ./requirements.txt /requirements.txt
# --virtual .tmp gcc libc-dev linux-header - они нужны только для установки зависимостей(wsgi), после
# установки мы удаляем их
# RUN apk add --update --no-cache --virtual .tmp gcc libc-dev linux-headers
# RUN pip install -r requirements.txt
RUN \
apk add --no-cache python3 postgresql-libs && \
apk add --no-cache --virtual .build-deps gcc python3-dev musl-dev postgresql-dev && \
python3 -m pip install -r requirements.txt --no-cache-dir && \
apk --purge del .build-deps
# RUN apk del .tmp
RUN mkdir /app
# RUN mkdir /dist
COPY ./app /app
# COPY ./frontend/hack_project/dist /dist
WORKDIR /app
COPY ./scripts /scripts
RUN chmod +x /scripts/*
# RUN mkdir -p /vol/web/media
# RUN mkdir -p /vol/web/static
RUN adduser -D user
RUN chmod -R 777 /usr/local/lib/python3.8/site-packages/
# RUN chmod -R 777 /dist/
# RUN chown -R user:user /vol
# RUN chmod -R 755 /vol/web
USER user
# CMD ["entrypoint.sh"]