diff --git a/bin/docker-backend b/bin/docker-backend new file mode 100755 index 00000000000..83c87d3d4ae --- /dev/null +++ b/bin/docker-backend @@ -0,0 +1,7 @@ +#!/bin/bash + +set -e + +python manage.py migrate + +python manage.py runserver 0.0.0.0:8000 diff --git a/dev.Dockerfile b/dev.Dockerfile index 124871e31c1..3a1c5acf421 100644 --- a/dev.Dockerfile +++ b/dev.Dockerfile @@ -11,7 +11,7 @@ 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' \ + && 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 \ @@ -23,6 +23,7 @@ RUN apt-get update \ && yarn --frozen-lockfile COPY requirements.txt . + RUN pip install -r requirements.txt --no-cache-dir COPY requirements-dev.txt . diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index dd346167b42..6248829140e 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -15,11 +15,11 @@ services: container_name: posthog_redis ports: - '6379:6379' - worker: &worker + backend: &backend build: context: . dockerfile: dev.Dockerfile - command: ./bin/docker-worker + command: ./bin/docker-backend volumes: - .:/code environment: @@ -36,9 +36,18 @@ services: links: - db:db - redis:redis - web: - <<: *worker - command: ./bin/docker-dev-web ports: - '8000:8000' - - '8234:8234' + #frontend: + #<<: *backend + #command: ./bin/docker-frontend + #ports: + #- '8234:8234' + worker: + <<: *backend + command: ./bin/docker-worker + ports: [] + depends_on: + - db + - redis + - backend