0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-21 13:39:22 +01:00

Docker support on the Apple M1 chip / arm64 (#4024)

* First pass at docker support on the Apple M1 chip

* Added version to libpq-dev so that it passes linter checks; Removed comments
This commit is contained in:
Buddy Williams 2021-04-19 10:12:02 -04:00 committed by GitHub
parent 5820087b00
commit c893765973
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 7 deletions

7
bin/docker-backend Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
set -e
python manage.py migrate
python manage.py runserver 0.0.0.0:8000

View File

@ -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 .

View File

@ -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