-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
executable file
·44 lines (35 loc) · 1.1 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
36
37
38
39
40
41
42
43
# This Project is built on the top of ALPINE
# which is a lightweight Linux distribution
FROM python:3.8-alpine
MAINTAINER Pratik Daigavane
#Run python in unbuffered mode to allow for log messages to be
#immediately dumped to the stream instead of being buffered.
ENV PYTHONUNBUFFERED 1
RUN set -e; \
apk add --no-cache --virtual .build-deps \
gcc \
libc-dev \
linux-headers \
mariadb-dev \
python3-dev \
;
# Install all dependencies
COPY ./requirements.txt /requirements.txt
RUN pip install -r requirements.txt
RUN apk add ffmpeg
RUN apk del .build-deps
RUN apk add --no-cache mariadb-connector-c-dev
# Copying app to docker and making it as working directory
RUN mkdir /app
WORKDIR /app
COPY ./app /app
# Directory which holds static assets
RUN mkdir -p /vol/web/media
RUN mkdir -p /vol/web/static
#Creating a user
RUN adduser -D user
#setting the folder permissions for static assets directory
RUN chown -R user:user /vol/
RUN chmod -R 755 /vol/web
#switching to user with limited permissions for better security
USER user