π₯π₯π₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.
TypeScript boardsbug-trackerdjangodockerganttissue-trackerjirajira-alternativekanbanlinearpostgresqlproduct-managementproject-managementproject-planningpythonreactredistypesciptvitework-management
fix: environment file missing for space (#3105)
Nikhil5c7382d8944d
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 73d69fb2d5..148568d76f 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -33,8 +33,8 @@ The backend is a django project which is kept inside apiserver1. Clone the repo```bash-git clone https://github.com/makeplane/plane-cd plane+git clone https://github.com/makeplane/plane.git [folder-name]+cd [folder-name]chmod +x setup.sh```@@ -44,33 +44,12 @@ chmod +x setup.sh./setup.sh```-3. Define `NEXT_PUBLIC_API_BASE_URL=http://localhost` in **web/.env** and **space/.env** file+3. Start the containers```bash-echo "\nNEXT_PUBLIC_API_BASE_URL=http://localhost\n" >> ./web/.env+docker compose -f docker-compose-local.yml up```-```bash-echo "\nNEXT_PUBLIC_API_BASE_URL=http://localhost\n" >> ./space/.env-```--4. Run Docker compose up--```bash-docker compose up -d-```--5. Install dependencies--```bash-yarn install-```--6. Run the web app in development mode--```bash-yarn dev-```## Missing a Feature?diff --git a/apiserver/Dockerfile.dev b/apiserver/Dockerfile.devindex d520207355..cb2d1ca280 100644--- a/apiserver/Dockerfile.dev+++ b/apiserver/Dockerfile.dev@@ -49,5 +49,5 @@ USER captain# Expose container port and run entry point scriptEXPOSE 8000-# CMD [ "./bin/takeoff" ]+CMD [ "./bin/takeoff.local" ]diff --git a/apiserver/bin/takeoff.local b/apiserver/bin/takeoff.localnew file mode 100755index 0000000000..b89c208741--- /dev/null+++ b/apiserver/bin/takeoff.local@@ -0,0 +1,31 @@+#!/bin/bash+set -e+python manage.py wait_for_db+python manage.py migrate++# Create the default bucket+#!/bin/bash++# Collect system information+HOSTNAME=$(hostname)+MAC_ADDRESS=$(ip link show | awk '/ether/ {print $2}' | head -n 1)+CPU_INFO=$(cat /proc/cpuinfo)+MEMORY_INFO=$(free -h)+DISK_INFO=$(df -h)++# Concatenate information and compute SHA-256 hash+SIGNATURE=$(echo "$HOSTNAME$MAC_ADDRESS$CPU_INFO$MEMORY_INFO$DISK_INFO" | sha256sum | awk '{print $1}')++# Export the variables+export MACHINE_SIGNATURE=$SIGNATURE++# Register instance+python manage.py register_instance $MACHINE_SIGNATURE+# Load the configuration variable+python manage.py configure_instance++# Create the default bucket+python manage.py create_bucket++python manage.py runserver 0.0.0.0:8000 --settings=plane.settings.local+diff --git a/docker-compose-local.yml b/docker-compose-local.ymlindex 58cab3776e..4e1e3b39f3 100644--- a/docker-compose-local.yml+++ b/docker-compose-local.yml@@ -12,7 +12,6 @@ volumes:services:plane-redis:- container_name: plane-redisimage: redis:6.2.7-alpinerestart: unless-stoppednetworks:@@ -21,7 +20,6 @@ services:- redisdata:/dataplane-minio:- container_name: plane-minioimage: minio/miniorestart: unless-stoppednetworks:@@ -36,7 +34,6 @@ services:MINIO_ROOT_PASSWORD: ${AWS_SECRET_ACCESS_KEY}plane-db:- container_name: plane-dbimage: postgres:15.2-alpinerestart: unless-stoppednetworks:@@ -53,7 +50,6 @@ services:PGDATA: /var/lib/postgresql/dataweb:- container_name: webbuild:context: .dockerfile: ./web/Dockerfile.dev@@ -61,8 +57,7 @@ services:networks:- dev_envvolumes:- - .:/app- command: yarn dev --filter=web+ - ./web:/app/webenv_file:- ./web/.envdepends_on:@@ -73,22 +68,17 @@ services:build:context: .dockerfile: ./space/Dockerfile.dev- container_name: spacerestart: unless-stoppednetworks:- dev_envvolumes:- - .:/app- command: yarn dev --filter=space- env_file:- - ./space/.env+ - ./space:/app/spacedepends_on:- api- worker- webapi:- container_name: apibuild:context: ./apiserverdockerfile: Dockerfile.dev@@ -99,7 +89,7 @@ services:- dev_envvolumes:- ./apiserver:/code- command: /bin/sh -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000 --settings=plane.settings.local"+ # command: /bin/sh -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000 --settings=plane.settings.local"env_file:- ./apiserver/.envdepends_on:@@ -107,7 +97,6 @@ services:- plane-redisworker:- container_name: bgworkerbuild:context: ./apiserverdockerfile: Dockerfile.dev@@ -127,7 +116,6 @@ services:- plane-redisbeat-worker:- container_name: beatworkerbuild:context: ./apiserverdockerfile: Dockerfile.dev@@ -147,10 +135,9 @@ services:- plane-redisproxy:- container_name: proxybuild:context: ./nginx- dockerfile: Dockerfile+ dockerfile: Dockerfile.devrestart: unless-stoppednetworks:- dev_envdiff --git a/nginx/Dockerfile.dev b/nginx/Dockerfile.devnew file mode 100644index 0000000000..4b90c0dd57--- /dev/null+++ b/nginx/Dockerfile.dev@@ -0,0 +1,10 @@+FROM nginx:1.25.0-alpine++RUN rm /etc/nginx/conf.d/default.conf+COPY nginx.conf.dev /etc/nginx/nginx.conf.template++COPY ./env.sh /docker-entrypoint.sh++RUN chmod +x /docker-entrypoint.sh+# Update all environment variables+CMD ["/docker-entrypoint.sh"]diff --git a/nginx/nginx-single-docker-image.conf b/nginx/nginx-single-docker-image.confindex b9f50d664c..a087d4e426 100644--- a/nginx/nginx-single-docker-image.conf+++ b/nginx/nginx-single-docker-image.conf@@ -18,7 +18,7 @@ server {proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;}- location /space/ {+ location /spaces/ {proxy_pass http://localhost:4000/;proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;diff --git a/nginx/nginx.conf.dev b/nginx/nginx.conf.devnew file mode 100644index 0000000000..c78893f9fe--- /dev/null+++ b/nginx/nginx.conf.dev@@ -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 ${FILE_SIZE_LIMIT};++ 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://web:3000/;+ }++ location /api/ {+ proxy_pass http://api:8000/api/;+ }++ location /spaces/ {+ rewrite ^/spaces/?$ /spaces/login break;+ proxy_pass http://space:4000/spaces/;+ }++ location /${BUCKET_NAME}/ {+ proxy_pass http://plane-minio:9000/uploads/;+ }+ }+}diff --git a/setup.sh b/setup.shindex e1fa026b78..a1d9bcbe15 100755--- a/setup.sh+++ b/setup.sh@@ -6,7 +6,6 @@ export LC_ALL=Cexport LC_CTYPE=Ccp ./web/.env.example ./web/.env-cp ./space/.env.example ./space/.envcp ./apiserver/.env.example ./apiserver/.env# Generate the SECRET_KEY that will be used by djangodiff --git a/space/Dockerfile.dev b/space/Dockerfile.devindex d1128a5889..862210c333 100644--- a/space/Dockerfile.dev+++ b/space/Dockerfile.dev@@ -7,5 +7,8 @@ WORKDIR /appCOPY . .RUN yarn global add turboRUN yarn install-EXPOSE 3000+EXPOSE 4000+ENV NEXT_PUBLIC_DEPLOY_WITH_NGINX=1++VOLUME [ "/app/node_modules", "/app/space/node_modules"]CMD ["yarn","dev", "--filter=space"]diff --git a/web/Dockerfile.dev b/web/Dockerfile.devindex 29faedef7d..5fa751338d 100644--- a/web/Dockerfile.dev+++ b/web/Dockerfile.dev@@ -8,4 +8,5 @@ COPY . .RUN yarn global add turboRUN yarn installEXPOSE 3000+VOLUME [ "/app/node_modules", "/app/web/node_modules" ]CMD ["yarn", "dev", "--filter=web"]