forked from PostHog/posthog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev.Dockerfile
52 lines (39 loc) · 1.5 KB
/
dev.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
46
47
48
49
50
51
52
FROM python:3.8-slim
ENV PYTHONUNBUFFERED 1
ENV DEBUG 1
EXPOSE 8000
EXPOSE 8234
WORKDIR /code/
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update \
&& apt-get install -y --no-install-recommends 'curl=7.*' 'git=1:2.*' 'build-essential=12.6' 'libpq-dev=11.*' \
&& curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& curl -sL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends 'nodejs=14.*' 'postgresql-client-12=12.*' \
&& rm -rf /var/lib/apt/lists/* \
&& npm install -g yarn@1 \
&& yarn config set network-timeout 300000 \
&& yarn --frozen-lockfile
COPY requirements-dev.txt .
RUN pip install -r requirements-dev.txt --compile --no-cache-dir
COPY requirements.txt .
RUN pip install -r requirements.txt --no-cache-dir
COPY package.json .
COPY yarn.lock .
COPY webpack.config.js .
COPY postcss.config.js .
COPY babel.config.js .
COPY tsconfig.json .
COPY .kearc .
COPY frontend/ frontend/
RUN mkdir plugins
COPY plugins/package.json plugins/
COPY plugins/yarn.lock plugins/
COPY . .
# generate Django's static files
RUN DATABASE_URL='postgres:///' REDIS_URL='redis:///' mkdir frontend/dist && python manage.py collectstatic --noinput
# install frontend dependencies
RUN yarn install && yarn install --cwd plugins && yarn cache clean
CMD ["./bin/docker-dev"]