-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
executable file
·40 lines (30 loc) · 972 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
FROM python:3.8-slim
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PATH="/scripts:${PATH}"
RUN pip install --upgrade pip
COPY ./requirements.txt /requirements.txt
# packages required for setting up WSGI
RUN apt-get update
RUN apt-get install -y --no-install-recommends gcc libc-dev python3-opencv python3-dev postgresql
RUN pip install -r /requirements.txt
# RUN service rabbitmq-server start
RUN mkdir /app
COPY ./src /app
WORKDIR /app
COPY ./scripts /scripts
RUN chmod +x /scripts/*
# folder to serve media files by nginx
RUN mkdir -p /vol/web/media
# folder to serve static files by nginx
RUN mkdir -p /vol/web/static
# always good to run our src with a different user other than root user
RUN useradd user
RUN chown -R user:user /vol
# chmod 755 means read and execute access to the user and write access to the owner
RUN chmod -R 755 /vol/web
RUN chown -R user:user /app
RUN chmod -R 755 /app
# switch to our user
USER user
CMD ["entrypoint.sh"]