-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
35 lines (27 loc) · 862 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
FROM python:3.6
ENV PYTHONUNBUFFERED 1
# Install packages
RUN apt-get update
RUN apt-get install apt-transport-https sudo -y
# Create User docker
RUN useradd -ms /bin/bash docker
RUN echo "docker ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# create env valies
ENV PROJECT_DIR /home/docker/public
ENV MEDIA_DIR /home/docker/media
ENV REQUIREMENTS_DIR /home/docker/public/requirements
# Create Folders
RUN mkdir $PROJECT_DIR
RUN mkdir $MEDIA_DIR
RUN mkdir $REQUIREMENTS_DIR
# Change owner and group
RUN chown -R docker:docker $PROJECT_DIR
RUN chown -R docker:docker $MEDIA_DIR
# Copy requirements files
COPY src/requirements/base.txt /home/docker/public/requirements
COPY src/requirements/local.txt /home/docker/public/requirements
# Install pip requiremntes
RUN pip install -r $REQUIREMENTS_DIR/local.txt
# Init Project
WORKDIR /home/docker/public
USER docker