mirror of
https://github.com/makeplane/plane
synced 2025-08-07 19:59:33 +00:00
Compare commits
5 Commits
fix-sub-wo
...
stable
| Author | SHA1 | Date | |
|---|---|---|---|
|
0ca66a1d94
|
|||
|
34d35a8da0
|
|||
|
37c51cfca5
|
|||
|
585d9a1d1b
|
|||
|
f3d05fda62
|
@@ -2,8 +2,6 @@
|
||||
*.pyc
|
||||
.env
|
||||
venv
|
||||
node_modules/
|
||||
**/node_modules/
|
||||
npm-debug.log
|
||||
.next/
|
||||
**/.next/
|
||||
@@ -14,4 +12,4 @@ build/
|
||||
out/
|
||||
**/out/
|
||||
dist/
|
||||
**/dist/
|
||||
**/dist/
|
||||
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,3 +1,7 @@
|
||||
pg_data
|
||||
redis_data
|
||||
minio_data
|
||||
|
||||
node_modules
|
||||
.next
|
||||
|
||||
|
||||
77
Dockerfile
Normal file
77
Dockerfile
Normal file
@@ -0,0 +1,77 @@
|
||||
FROM debian:bookworm
|
||||
|
||||
RUN --mount=type=cache,target=/var/cache/apt \
|
||||
apt-get update && apt-get install -y wget nginx procps lsb-release tmux python3 python3-pip nodejs npm curl
|
||||
|
||||
RUN wget https://dl.min.io/server/minio/release/linux-amd64/archive/minio_20240629012047.0.0_amd64.deb -O minio.deb
|
||||
RUN apt-get install -y -f ./minio.deb
|
||||
|
||||
RUN wget https://go.dev/dl/go1.22.4.linux-amd64.tar.gz
|
||||
RUN tar -C /usr/local -xzf go1.22.4.linux-amd64.tar.gz
|
||||
|
||||
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/root/go/bin
|
||||
RUN go install github.com/DarthSim/overmind/v2@latest
|
||||
|
||||
RUN npm i -g yarn && yarn set version 1.22.19
|
||||
|
||||
SHELL ["/bin/bash", "-c"]
|
||||
|
||||
RUN --mount=type=cache,target=/root/.cache/yarn \
|
||||
--mount=type=cache,target=/var/cache/apt \
|
||||
sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' \
|
||||
&& wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
|
||||
&& apt-get update \
|
||||
&& apt-get -y install postgresql libpq-dev
|
||||
|
||||
RUN --mount=type=cache,target=/root/.cache/yarn \
|
||||
--mount=type=cache,target=/var/cache/apt \
|
||||
set -eo pipefail; \
|
||||
curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg; \
|
||||
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb bookworm main" | tee /etc/apt/sources.list.d/redis.list; \
|
||||
apt-get update; \
|
||||
apt-get install -y redis
|
||||
|
||||
RUN apt-get install --reinstall python3 python3-pip
|
||||
|
||||
RUN mkdir /app
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json turbo.json yarn.lock app.json .
|
||||
COPY packages packages
|
||||
COPY web web
|
||||
COPY space space
|
||||
|
||||
RUN --mount=type=cache,target=/root/.cache/yarn \
|
||||
yarn install --frozen-lockfile \
|
||||
&& yarn build \
|
||||
&& rm -rf node_modules
|
||||
|
||||
RUN mkdir -p web/.next/standalone/web/.next \
|
||||
&& mv web/public web/.next/standalone/web/public \
|
||||
&& mv web/.next/static web/.next/standalone/web/.next/static \
|
||||
&& mkdir -p space/.next/standalone/_next \
|
||||
&& mv space/public space/.next/standalone/space/public \
|
||||
&& mv space/.next/static space/.next/standalone/space/.next/static
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
|
||||
|
||||
COPY apiserver apiserver
|
||||
|
||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
cd apiserver \
|
||||
&& pip install --break-system-packages -r requirements.txt --compile \
|
||||
&& pip install --break-system-packages -r requirements/local.txt --compile
|
||||
|
||||
COPY docker/etc/ /etc/
|
||||
|
||||
RUN chmod -R 755 /root \
|
||||
&& chmod -R 755 apiserver \
|
||||
&& chmod -R 755 web \
|
||||
&& chmod -R 755 space \
|
||||
&& chmod +x /etc/db-run.sh
|
||||
|
||||
RUN apt-get install -y python-is-python3 python3-setuptools
|
||||
|
||||
ENTRYPOINT ["bash", "/etc/entrypoint.sh"]
|
||||
@@ -32,4 +32,4 @@ python manage.py create_bucket
|
||||
# Clear Cache before starting to remove stale values
|
||||
python manage.py clear_cache
|
||||
|
||||
exec gunicorn -w "$GUNICORN_WORKERS" -k uvicorn.workers.UvicornWorker plane.asgi:application --bind 0.0.0.0:"${PORT:-8000}" --max-requests 1200 --max-requests-jitter 1000 --access-logfile -
|
||||
exec gunicorn --log-level debug --timeout 30 -w "$GUNICORN_WORKERS" -k uvicorn.workers.UvicornWorker plane.asgi:application --bind 0.0.0.0:"${PORT:-8000}" --max-requests 1200 --max-requests-jitter 1000 --access-logfile -
|
||||
|
||||
10
docker/etc/Procfile
Normal file
10
docker/etc/Procfile
Normal file
@@ -0,0 +1,10 @@
|
||||
migrator: sh -c "cd /app/apiserver && python manage.py wait_for_db --settings=plane.settings.local && python manage.py migrate --settings=plane.settings.local"
|
||||
api: cd /app/apiserver/ && bin/takeoff
|
||||
api-beatworker: cd /app/apiserver/ && bin/beat
|
||||
api-worker: cd /app/apiserver/ && bin/worker
|
||||
db: /etc/db-run.sh
|
||||
minio: minio server /ext/minio_data --console-address ":9090"
|
||||
nginx: nginx -g "daemon off;"
|
||||
redis: /usr/bin/redis-server /etc/redis/redis.conf
|
||||
spaces: cd /app/space/.next/standalone/space && HOSTNAME=127.0.0.1 PORT=3001 node server.js space
|
||||
web: cd /app/web/.next/standalone/web && NEXT_PUBLIC_DEPLOY_URL="http://localhost/spaces" HOSTNAME=127.0.0.1 PORT=3000 node server.js web
|
||||
34
docker/etc/db-run.sh
Normal file
34
docker/etc/db-run.sh
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
script=$(mktemp)
|
||||
chmod 777 "$script"
|
||||
|
||||
chmod -R 750 /ext/pg_data
|
||||
chown -R postgres:postgres /ext/pg_data
|
||||
|
||||
cat << "EOSH" > "$script"
|
||||
set -m
|
||||
|
||||
PGBIN=/usr/lib/postgresql/16/bin/
|
||||
PGSHARE=/usr/share/postgresql/16/
|
||||
|
||||
export POSTGRES_USER=plane
|
||||
export POSTGRES_PASSWORD=plane
|
||||
export POSTGRES_DB=plane
|
||||
export PGDATA=/ext/pg_data
|
||||
export ROOT_DB_URL=postgresql://plane:plane@localhost:5432/postgres
|
||||
export TZ=GMT
|
||||
|
||||
pwfile=$(mktemp)
|
||||
echo -n $POSTGRES_PASSWORD > $pwfile
|
||||
|
||||
$PGBIN/initdb -U $POSTGRES_USER --pwfile=$pwfile --no-locale -L $PGSHARE || true
|
||||
$PGBIN/postgres -c 'max_connections=1000' & true;
|
||||
|
||||
until pg_isready; do sleep 1; done;
|
||||
|
||||
psql -d postgres -c 'create database plane;'
|
||||
|
||||
fg %1
|
||||
EOSH
|
||||
|
||||
su postgres -c "/bin/bash $script"
|
||||
9
docker/etc/entrypoint.sh
Executable file
9
docker/etc/entrypoint.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#! /bin/bash
|
||||
mkdir -p /ext/redis_data /ext/minio_data /ext/pg_data
|
||||
|
||||
export PATH=$PATH:/usr/bin:/usr/local/bin:/root/go/bin:/bin:/usr/sbin:/usr/local/sbin
|
||||
|
||||
OVERMIND_CAN_DIE=migrator \
|
||||
OVERMIND_AUTO_RESTART=api,web,spaces,api-worker,api-beatworker \
|
||||
OVERMIND_NO_PORT=1 \
|
||||
overmind start -f /etc/Procfile
|
||||
36
docker/etc/nginx/nginx.conf
Normal file
36
docker/etc/nginx/nginx.conf
Normal file
@@ -0,0 +1,36 @@
|
||||
events {
|
||||
}
|
||||
|
||||
http {
|
||||
sendfile on;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
root /www/data/;
|
||||
access_log /var/log/nginx/access.log;
|
||||
|
||||
client_max_body_size 5242880;
|
||||
|
||||
add_header X-Content-Type-Options "nosniff" always;
|
||||
add_header Referrer-Policy "no-referrer-when-downgrade" always;
|
||||
add_header Permissions-Policy "interest-cohort=()" always;
|
||||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
|
||||
|
||||
location / {
|
||||
proxy_pass http://localhost:3000/;
|
||||
}
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://localhost:8000/api/;
|
||||
}
|
||||
|
||||
location /spaces/ {
|
||||
rewrite ^/spaces/?$ /spaces/login break;
|
||||
proxy_pass http://localhost:3001/spaces/;
|
||||
}
|
||||
|
||||
location /uploads/ {
|
||||
proxy_pass http://localhost:9000/uploads/;
|
||||
}
|
||||
}
|
||||
}
|
||||
2296
docker/etc/redis/redis.conf
Normal file
2296
docker/etc/redis/redis.conf
Normal file
File diff suppressed because it is too large
Load Diff
56
fly.toml
Normal file
56
fly.toml
Normal file
@@ -0,0 +1,56 @@
|
||||
# fly.toml app configuration file generated for orion-plane on 2024-06-29T13:11:37-05:00
|
||||
#
|
||||
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
|
||||
#
|
||||
|
||||
app = 'orion-plane'
|
||||
primary_region = 'ord'
|
||||
|
||||
[build]
|
||||
dockerfile = "Dockerfile"
|
||||
|
||||
[env]
|
||||
AWS_S3_BUCKET_NAME = 'uploads'
|
||||
AWS_S3_ENDPOINT_URL = 'http://localhost:9000'
|
||||
CORS_ALLOWED_ORIGINS = 'http://plane.scour.cc'
|
||||
DATABASE_URL = 'postgresql://plane:plane@localhost:5432/plane'
|
||||
DEBUG = '0'
|
||||
ENABLE_EMAIL_PASSWORD = '0'
|
||||
ENABLE_MAGIC_LINK_LOGIN = '0'
|
||||
ENABLE_SIGNUP = '0'
|
||||
FILE_SIZE_LIMIT = '5242880'
|
||||
GUNICORN_WORKERS = '2'
|
||||
NEXT_PUBLIC_DEPLOY_WITH_NGINX = '1'
|
||||
NEXT_PUBLIC_ENABLE_OAUTH = '0'
|
||||
NEXT_PUBLIC_ENABLE_SENTRY = '0'
|
||||
NEXT_PUBLIC_ENABLE_SESSION_RECORDER = '0'
|
||||
NEXT_PUBLIC_TRACK_EVENTS = '0'
|
||||
NGINX_PORT = '80'
|
||||
PGDATABASE = 'plane'
|
||||
PGHOST = 'localhost'
|
||||
PGPASSWORD = 'plane'
|
||||
PGUSER = 'plane'
|
||||
POSTGRES_PASSWORD = 'plane'
|
||||
POSTGRES_USER = 'plane'
|
||||
REDIS_HOST = 'localhost'
|
||||
REDIS_PORT = '6379'
|
||||
REDIS_URL = 'redis://localhost:6379/'
|
||||
SENTRY_ENVIRONMENT = 'development'
|
||||
USE_MINIO = '1'
|
||||
WEB_URL = 'http://plane.scour.cc'
|
||||
|
||||
[[mounts]]
|
||||
source = 'volume'
|
||||
destination = '/ext'
|
||||
|
||||
[http_service]
|
||||
internal_port = 80
|
||||
force_https = true
|
||||
auto_stop_machines = true
|
||||
auto_start_machines = true
|
||||
min_machines_running = 1
|
||||
processes = ['app']
|
||||
|
||||
[[vm]]
|
||||
size = 'shared-cpu-2x'
|
||||
memory = '1gb'
|
||||
Reference in New Issue
Block a user