-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
44 lines (41 loc) · 1.11 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
44
FROM python:3.8.7
ENV PYTHONUNBUFFERED 1
ARG DJANGO_ALLOWED_HOSTS
ARG DJANGO_SECRET_KEY
ARG DJANGO_CORS_ORIGIN_WHITELIST
ARG BACKEND_ADMIN
ARG RDS_HOSTNAME
ARG RDS_PORT
ARG RDS_DB_NAME
ARG RDS_USERNAME
ARG RDS_PASSWORD
ARG S3_ACCESS_KEY_ID
ARG S3_SECRET_ACCESS_KEY
ARG S3_BUCKET_NAME
ARG DEBUG
ENV DJANGO_ALLOWED_HOSTS $DJANGO_ALLOWED_HOSTS
ENV DJANGO_SECRET_KEY $DJANGO_SECRET_KEY
ENV DJANGO_CORS_ORIGIN_WHITELIST $DJANGO_CORS_ORIGIN_WHITELIST
ENV BACKEND_ADMIN $BACKEND_ADMIN
ENV RDS_HOSTNAME $RDS_HOSTNAME
ENV RDS_PORT $RDS_PORT
ENV RDS_DB_NAME $RDS_DB_NAME
ENV RDS_USERNAME $RDS_USERNAME
ENV RDS_PASSWORD $RDS_PASSWORD
ENV S3_ACCESS_KEY_ID $S3_ACCESS_KEY_ID
ENV S3_SECRET_ACCESS_KEY $S3_SECRET_ACCESS_KEY
ENV S3_BUCKET_NAME $S3_BUCKET_NAME
ENV DEBUG $DEBUG
RUN mkdir /backend
WORKDIR /backend
COPY Pipfile /backend/
COPY Pipfile.lock /backend/
EXPOSE 8000
RUN pip3 install pipenv
RUN pip3 install pipenv-to-requirements
RUN pipenv run pipenv_to_requirements -f
RUN pip3 install -r requirements.txt
COPY . /backend/
RUN python manage.py makemigrations
RUN python manage.py migrate
# RUN python manage.py collectstatic --no-input