-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
45 lines (33 loc) · 1.41 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
45
FROM python:3.6 as base
WORKDIR /usr/src/app
ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1
# Install en_US.UTF-8 locale required for localization
RUN apt-get update && apt-get install -y locales && \
sed -i 's/\# en_US.UTF-8/en_US.UTF-8/' /etc/locale.gen && \
locale-gen en_US.UTF-8
# Install js dependencies
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
apt-get install -y nodejs && \
npm install -g yarn
FROM base as dependencies
# Install tracker dependencies
COPY ../django-donation-tracker/package.json \
../django-donation-tracker/setup.py \
../django-donation-tracker/yarn.lock \
../django-donation-tracker/README.md \
./django-donation-tracker/
RUN pip install --upgrade pip && \
(cd django-donation-tracker && mkdir tracker && pip install . && yarn --production)
FROM base
COPY ../django-donation-tracker ./django-donation-tracker
COPY --from=dependencies /root/.cache /root/.cache
COPY --from=dependencies /usr/src/app/django-donation-tracker/node_modules /usr/src/app/django-donation-tracker/node_modules
# Install tracker itself
RUN pip install --upgrade pip && \
(cd django-donation-tracker && python setup.py package) && \
pip install ./django-donation-tracker
# Install additional python dependencies
RUN pip install psycopg2-binary dj-database-url
COPY ../manage.py ./
COPY ../tracker_project ./tracker