2022-08-24 15:02:33 +02:00
|
|
|
#
|
2024-02-27 15:22:33 +01:00
|
|
|
# Extend the non-Cloud image with anything required for PostHog Cloud
|
2022-08-24 15:02:33 +02:00
|
|
|
#
|
|
|
|
ARG BASE_IMAGE
|
|
|
|
FROM ${BASE_IMAGE}
|
|
|
|
|
|
|
|
WORKDIR /code/
|
|
|
|
|
|
|
|
USER root
|
|
|
|
|
2022-09-20 14:56:46 +02:00
|
|
|
# TLS: add in our own root CAs for the deployment environment, such that we can
|
|
|
|
# validate certs. See
|
|
|
|
# https://github.com/PostHog/posthog-cloud-infra/tree/main/pki for details of
|
|
|
|
# the setup.
|
|
|
|
COPY ./certs/* /usr/local/share/ca-certificates/
|
|
|
|
RUN chmod 644 /usr/local/share/ca-certificates/posthog-*.crt && update-ca-certificates
|
|
|
|
|
2022-08-24 15:02:33 +02:00
|
|
|
# Add in requirements we don't have in the base image
|
|
|
|
COPY requirements.txt /code/cloud_requirements.txt
|
|
|
|
RUN pip install -r cloud_requirements.txt --no-cache-dir
|
|
|
|
|
|
|
|
COPY ./multi_tenancy /code/multi_tenancy/
|
|
|
|
COPY ./messaging /code/messaging/
|
|
|
|
COPY ./multi_tenancy_settings.py /code/cloud_settings.py
|
|
|
|
RUN cat /code/cloud_settings.py > /code/posthog/settings/cloud.py
|
|
|
|
|
|
|
|
USER posthog
|
|
|
|
|
|
|
|
RUN DATABASE_URL='postgres:///' REDIS_URL='redis:///' SECRET_KEY='no' python manage.py collectstatic --noinput
|