Clean up docker compose file for selfhosting (#1022)

* Clean up docker compose file

Removed nginx container (might want to put it back?)
Changed spacing to tabs for better readability
Changed the order, first the important stuff (plane) and later the database/redis
All containers should be in the same format (first container_name, then image, then restart, etc.).
Removed links because deprecated since compose version 2, all containers are in one docker network
Removed build from plane-api
Removed ports from redis and postgresql
Removed PGDATA directory because that's the default one
Renamed redis and db to plane-redis and plane-db

* Fixed spacing (again)

* Fix spacing (attempt 3)

* Pasting error - should be good now

* New compose download instructions

---------

Co-authored-by: pablohashescobar <118773738+pablohashescobar@users.noreply.github.com>
This commit is contained in:
Robin 2023-05-25 07:19:37 +02:00 committed by GitHub
parent 0fb4a87454
commit e526a01295
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 130 additions and 140 deletions

View File

@ -45,16 +45,12 @@ The easiest way to get started with Plane is by creating a [Plane Cloud](https:/
### Docker Compose Setup ### Docker Compose Setup
- Clone the Repository - Download the docker-compose.yml and setup.sh file
```bash ```bash
git clone https://github.com/makeplane/plane curl https://raw.githubusercontent.com/makeplane/plane/develop/docker-compose-hub.yml --output docker-compose.yml
``` curl https://raw.githubusercontent.com/makeplane/plane/develop/setup.sh --output setup.sh
chmod +x setup.sh
- Change Directory
```bash
cd plane
``` ```
- Run setup.sh - Run setup.sh
@ -76,7 +72,7 @@ set +a
- Run Docker compose up - Run Docker compose up
```bash ```bash
docker-compose -f docker-compose-hub.yml up docker compose up -d
``` ```
<strong>You can use the default email and password for your first login `captain@plane.so` and `password123`.</strong> <strong>You can use the default email and password for your first login `captain@plane.so` and `password123`.</strong>

View File

@ -1,136 +1,130 @@
version: "3.8" version: "3.8"
services: services:
nginx: plane-web:
container_name: nginx container_name: planefrontend
build: image: makeplane/plane-frontend:0.6
context: ./nginx restart: always
dockerfile: Dockerfile command: /usr/local/bin/start.sh
ports: environment:
- 80:80 NEXT_PUBLIC_API_BASE_URL: ${NEXT_PUBLIC_API_BASE_URL}
depends_on: NEXT_PUBLIC_GOOGLE_CLIENTID: 0
- plane-web NEXT_PUBLIC_GITHUB_APP_NAME: 0
- plane-api NEXT_PUBLIC_GITHUB_ID: 0
db: NEXT_PUBLIC_SENTRY_DSN: 0
image: postgres:15.2-alpine NEXT_PUBLIC_ENABLE_OAUTH: 0
container_name: db NEXT_PUBLIC_ENABLE_SENTRY: 0
restart: always ports:
volumes: - 3000:3000
- pgdata:/var/lib/postgresql/data
environment: plane-api:
POSTGRES_USER: plane container_name: planebackend
POSTGRES_DB: plane image: makeplane/plane-backend:0.6
POSTGRES_PASSWORD: xyzzyspoon restart: always
PGDATA: /var/lib/postgresql/data command: ./bin/takeoff
command: postgres -c 'max_connections=1000' environment:
ports: DJANGO_SETTINGS_MODULE: plane.settings.production
- 5432:5432 DATABASE_URL: postgres://plane:xyzzyspoon@plane-db:5432/plane
redis: REDIS_URL: redis://plane-redis:6379/
image: redis:6.2.7-alpine EMAIL_HOST: ${EMAIL_HOST}
container_name: redis EMAIL_HOST_USER: ${EMAIL_HOST_USER}
restart: always EMAIL_HOST_PASSWORD: ${EMAIL_HOST_PASSWORD}
ports: AWS_REGION: ${AWS_REGION}
- 6379:6379 AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
volumes: AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
- redisdata:/data AWS_S3_BUCKET_NAME: ${AWS_S3_BUCKET_NAME}
plane-web: WEB_URL: localhost/
container_name: planefrontend GITHUB_CLIENT_SECRET: ${GITHUB_CLIENT_SECRET}
image: makeplane/plane-frontend:0.6 DISABLE_COLLECTSTATIC: 1
restart: always DOCKERIZED: 1
command: [ "/usr/local/bin/start.sh" ] OPENAI_API_KEY: ${OPENAI_API_KEY}
environment: GPT_ENGINE: ${GPT_ENGINE}
NEXT_PUBLIC_API_BASE_URL: ${NEXT_PUBLIC_API_BASE_URL} SECRET_KEY: ${SECRET_KEY}
NEXT_PUBLIC_GOOGLE_CLIENTID: 0 depends_on:
NEXT_PUBLIC_GITHUB_APP_NAME: 0 - plane-db
NEXT_PUBLIC_GITHUB_ID: 0 - plane-redis
NEXT_PUBLIC_SENTRY_DSN: 0 ports:
NEXT_PUBLIC_ENABLE_OAUTH: 0 - 8000:8000
NEXT_PUBLIC_ENABLE_SENTRY: 0
ports: plane-worker:
- 3000:3000 container_name: planerqworker
plane-api: image: makeplane/plane-worker:0.6
container_name: planebackend restart: always
image: makeplane/plane-backend:0.6 command: ./bin/worker
build: environment:
context: ./apiserver DJANGO_SETTINGS_MODULE: plane.settings.production
dockerfile: Dockerfile.api DATABASE_URL: postgres://plane:xyzzyspoon@plane-db:5432/plane
restart: always REDIS_URL: redis://plane-redis:6379/
ports: EMAIL_HOST: ${EMAIL_HOST}
- 8000:8000 EMAIL_HOST_USER: ${EMAIL_HOST_USER}
environment: EMAIL_HOST_PASSWORD: ${EMAIL_HOST_PASSWORD}
DJANGO_SETTINGS_MODULE: plane.settings.production AWS_REGION: ${AWS_REGION}
DATABASE_URL: postgres://plane:xyzzyspoon@db:5432/plane AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
REDIS_URL: redis://redis:6379/ AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
EMAIL_HOST: ${EMAIL_HOST} AWS_S3_BUCKET_NAME: ${AWS_S3_BUCKET_NAME}
EMAIL_HOST_USER: ${EMAIL_HOST_USER} WEB_URL: localhost/
EMAIL_HOST_PASSWORD: ${EMAIL_HOST_PASSWORD} GITHUB_CLIENT_SECRET: ${GITHUB_CLIENT_SECRET}
AWS_REGION: ${AWS_REGION} DISABLE_COLLECTSTATIC: 1
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID} DOCKERIZED: 1
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY} OPENAI_API_KEY: ${OPENAI_API_KEY}
AWS_S3_BUCKET_NAME: ${AWS_S3_BUCKET_NAME} GPT_ENGINE: ${GPT_ENGINE}
WEB_URL: ${WEB_URL} SECRET_KEY: ${SECRET_KEY}
GITHUB_CLIENT_SECRET: ${GITHUB_CLIENT_SECRET} depends_on:
DISABLE_COLLECTSTATIC: 1 - plane-api
DOCKERIZED: 1 - plane-db
OPENAI_API_KEY: ${OPENAI_API_KEY} - plane-redis
GPT_ENGINE: ${GPT_ENGINE}
SECRET_KEY: ${SECRET_KEY} plane-db:
depends_on: container_name: plane-db
- db image: postgres:15.2-alpine
- redis restart: always
command: ./bin/takeoff command: postgres -c 'max_connections=1000'
links: environment:
- db:db POSTGRES_USER: plane
- redis:redis POSTGRES_DB: plane
plane-worker: POSTGRES_PASSWORD: xyzzyspoon
container_name: planerqworker volumes:
image: makeplane/plane-worker:0.6 - pgdata:/var/lib/postgresql/data
depends_on:
- redis plane-redis:
- db container_name: plane-redis
- plane-api image: redis:6.2.7-alpine
command: ./bin/worker restart: always
links: volumes:
- redis:redis - redisdata:/data
- db:db
environment: plane-minio:
DJANGO_SETTINGS_MODULE: plane.settings.production container_name: plane-minio
DATABASE_URL: postgres://plane:xyzzyspoon@db:5432/plane image: minio/minio
REDIS_URL: redis://redis:6379/ environment:
EMAIL_HOST: ${EMAIL_HOST} MINIO_ROOT_USER: ${AWS_ACCESS_KEY_ID}
EMAIL_HOST_USER: ${EMAIL_HOST_USER} MINIO_ROOT_PASSWORD: ${AWS_SECRET_ACCESS_KEY}
EMAIL_HOST_PASSWORD: ${EMAIL_HOST_PASSWORD} command: server /export --console-address ":9090"
AWS_REGION: ${AWS_REGION}
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID} createbuckets:
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY} image: minio/mc
AWS_S3_BUCKET_NAME: ${AWS_S3_BUCKET_NAME} depends_on:
WEB_URL: ${WEB_URL} - minio
GITHUB_CLIENT_SECRET: ${GITHUB_CLIENT_SECRET} entrypoint: >
DISABLE_COLLECTSTATIC: 1 /bin/sh -c "
DOCKERIZED: 1 /usr/bin/mc config host add plane-minio http://minio:9000 \$AWS_ACCESS_KEY_ID \$AWS_SECRET_ACCESS_KEY;
OPENAI_API_KEY: ${OPENAI_API_KEY} /usr/bin/mc mb plane-minio/\$AWS_S3_BUCKET_NAME;
GPT_ENGINE: ${GPT_ENGINE} /usr/bin/mc anonymous set download plane-minio/\$AWS_S3_BUCKET_NAME;
SECRET_KEY: ${SECRET_KEY} exit 0;
minio: "
image: minio/minio
ports: nginx:
- 9000:9000 container_name: nginx
environment: build:
MINIO_ROOT_USER: ${AWS_ACCESS_KEY_ID} context: ./nginx
MINIO_ROOT_PASSWORD: ${AWS_SECRET_ACCESS_KEY} dockerfile: Dockerfile
command: server /export --console-address ":9090" ports:
- 80:80
depends_on:
- plane-web
- plane-api
createbuckets:
image: minio/mc
depends_on:
- minio
entrypoint: >
/bin/sh -c "
/usr/bin/mc config host add plane-minio http://minio:9000 \$AWS_ACCESS_KEY_ID \$AWS_SECRET_ACCESS_KEY;
/usr/bin/mc mb plane-minio/\$AWS_S3_BUCKET_NAME;
/usr/bin/mc anonymous set download plane-minio/\$AWS_S3_BUCKET_NAME;
exit 0;
"
volumes: volumes:
pgdata: pgdata:
redisdata: redisdata: