0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-22 08:40:03 +01:00
posthog/dev.Dockerfile
Marius Andra f1c90f4283
Whitelist kea-typegen folder in .dockerignore (#1443)
* Whitelist kea-typegen folder in .dockerignore

* Added debug to devdockerfile

* quote style fix

* add .kearc to dockerignore (needed to generate types in yarn build)

* Add tsconfig.json to dockerfile

* add tsconfig and kearc to dockerfiles

* updated docker files to suppress secret key error

* use fake secret key in collectstatic

Co-authored-by: Yakko Majuri <yakko.majuri@gmail.com>
2020-08-17 14:11:46 +02:00

37 lines
1.0 KiB
Docker

FROM python:3.8-slim
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code
COPY requirements.txt /code/
# install dependencies but ignore any we don't need for dev environment
RUN pip install $(grep -ivE "psycopg2" requirements.txt) --compile\
&& pip install psycopg2-binary
COPY package.json /code/
COPY yarn.lock /code/
COPY webpack.config.js /code/
COPY postcss.config.js /code/
COPY babel.config.js /code/
COPY tsconfig.json /code/
COPY .kearc /code/
COPY frontend/ /code/frontend
RUN apt-get update && apt-get install -y --no-install-recommends curl \
&& curl -sL https://deb.nodesource.com/setup_12.x | bash - \
&& apt-get install nodejs -y --no-install-recommends \
&& npm install -g yarn@1 \
&& yarn config set network-timeout 300000 \
&& yarn --frozen-lockfile
RUN mkdir /code/frontend/dist
COPY . /code/
RUN DEBUG=1 DATABASE_URL='postgres:///' REDIS_URL='redis:///' python manage.py collectstatic --noinput
EXPOSE 8000
EXPOSE 8234
RUN yarn install
RUN yarn build
CMD ["./bin/docker-dev"]