Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mguptahub committed Jun 25, 2024
1 parent 2cb0c74 commit 6a22edd
Show file tree
Hide file tree
Showing 10 changed files with 113 additions and 128 deletions.
3 changes: 3 additions & 0 deletions aio/Dockerfile-base-full
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ RUN mkdir -p /app/{data,logs} && \

# Create Supervisor configuration file
COPY supervisord-full-base /app/supervisord.conf
COPY nginx.conf /etc/nginx/nginx.conf.template
COPY ./nginx/env.sh /app/nginx-start.sh
RUN chmod +x /app/nginx-start.sh

RUN sudo -u postgres /usr/lib/postgresql/$POSTGRES_VERSION/bin/initdb -D /var/lib/postgresql/data
COPY postgresql.conf /etc/postgresql/postgresql.conf
Expand Down
3 changes: 3 additions & 0 deletions aio/Dockerfile-base-slim
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ RUN mkdir -p /app/{data,logs} && \

# Create Supervisor configuration file
COPY supervisord-slim-base /app/supervisord.conf
COPY nginx.conf /etc/nginx/nginx.conf.template
COPY ./nginx/env.sh /app/nginx-start.sh
RUN chmod +x /app/nginx-start.sh

# Expose ports for Redis, PostgreSQL, and MinIO
EXPOSE 80 443
Expand Down
17 changes: 8 additions & 9 deletions aio/Dockerfile-full
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ RUN yarn turbo run build
# STAGE 3: Copy the project and start it
# *****************************************************************************
# FROM makeplane/plane-aio-base AS runner
FROM makeplane/plane-aio-base-full:develop AS runner
ARG BASE_TAG=develop
FROM makeplane/plane-aio-base-full:$BASE_TAG AS runner

WORKDIR /app

Expand All @@ -70,10 +71,7 @@ ENV PIP_DISABLE_PIP_VERSION_CHECK=1
COPY apiserver/requirements.txt ./api/
COPY apiserver/requirements ./api/requirements

RUN python3.12 -m venv /app/venv && \
source /app/venv/bin/activate && \
/app/venv/bin/pip install --upgrade pip && \
/app/venv/bin/pip install -r ./api/requirements.txt --compile --no-cache-dir
RUN pip install -r ./api/requirements.txt --compile --no-cache-dir

# Add in Django deps and generate Django's static files
COPY apiserver/manage.py ./api/manage.py
Expand Down Expand Up @@ -127,7 +125,10 @@ ENV NEXT_PUBLIC_WEB_BASE_URL=$NEXT_PUBLIC_WEB_BASE_URL
ENV NEXT_TELEMETRY_DISABLED 1
ENV TURBO_TELEMETRY_DISABLED 1

COPY aio/supervisord.conf /app/supervisord.conf
COPY ./aio/nginx.conf /etc/nginx/nginx.conf.template
COPY aio/supervisord-app /app/supervisord-app
RUN cat /app/supervisord-app >> /app/supervisord.conf && \
rm /app/supervisord-app

COPY aio/aio.sh /app/aio.sh
RUN chmod +x /app/aio.sh
Expand All @@ -138,9 +139,7 @@ RUN chmod +x /app/pg-setup.sh
COPY deploy/selfhost/variables.env /app/plane.env

# NGINX Conf Copy
COPY ./aio/nginx.conf.aio /etc/nginx/nginx.conf.template
COPY ./nginx/env.sh /app/nginx-start.sh
RUN chmod +x /app/nginx-start.sh
COPY ./aio/nginx.conf /etc/nginx/nginx.conf.template

RUN ./pg-setup.sh

Expand Down
21 changes: 8 additions & 13 deletions aio/Dockerfile-slim
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ RUN yarn turbo run build
# STAGE 3: Copy the project and start it
# *****************************************************************************
# FROM makeplane/plane-aio-base AS runner
FROM makeplane/plane-aio-base-slim:develop AS runner
ARG BASE_TAG=develop
FROM makeplane/plane-aio-base-slim:$BASE_TAG AS runner

WORKDIR /app

Expand All @@ -70,10 +71,7 @@ ENV PIP_DISABLE_PIP_VERSION_CHECK=1
COPY apiserver/requirements.txt ./api/
COPY apiserver/requirements ./api/requirements

RUN python3.12 -m venv /app/venv && \
source /app/venv/bin/activate && \
/app/venv/bin/pip install --upgrade pip && \
/app/venv/bin/pip install -r ./api/requirements.txt --compile --no-cache-dir
RUN pip install -r ./api/requirements.txt --compile --no-cache-dir

# Add in Django deps and generate Django's static files
COPY apiserver/manage.py ./api/manage.py
Expand Down Expand Up @@ -127,7 +125,10 @@ ENV NEXT_PUBLIC_WEB_BASE_URL=$NEXT_PUBLIC_WEB_BASE_URL
ENV NEXT_TELEMETRY_DISABLED 1
ENV TURBO_TELEMETRY_DISABLED 1

COPY aio/supervisord.conf /app/supervisord.conf
COPY ./aio/nginx.conf /etc/nginx/nginx.conf.template
COPY aio/supervisord-app /app/supervisord-app
RUN cat /app/supervisord-app >> /app/supervisord.conf && \
rm /app/supervisord-app

COPY aio/aio.sh /app/aio.sh
RUN chmod +x /app/aio.sh
Expand All @@ -138,12 +139,6 @@ RUN chmod +x /app/pg-setup.sh
COPY deploy/selfhost/variables.env /app/plane.env

# NGINX Conf Copy
COPY ./aio/nginx.conf.aio /etc/nginx/nginx.conf.template
COPY ./nginx/env.sh /app/nginx-start.sh
RUN chmod +x /app/nginx-start.sh

RUN ./pg-setup.sh

VOLUME [ "/app/data/minio/uploads", "/var/lib/postgresql/data" ]
COPY ./aio/nginx.conf /etc/nginx/nginx.conf.template

CMD ["/usr/bin/supervisord", "-c", "/app/supervisord.conf"]
30 changes: 10 additions & 20 deletions aio/supervisord.conf → aio/a.txt
Original file line number Diff line number Diff line change
@@ -1,50 +1,40 @@
[supervisord]
user=root
nodaemon=true
priority=1
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes=0
stderr_logfile=/app/logs/error/supervisor.err.log
stdout_logfile=/app/logs/access/supervisor.log

[program:redis]
directory=/app/data/redis
command=redis-server
autostart=true
autorestart=true
priority=1
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes=0
stderr_logfile=/app/logs/error/redis.err.log
stdout_logfile=/app/logs/access/redis.log

[program:postgresql]
user=postgres
command=/usr/lib/postgresql/15/bin/postgres -D /var/lib/postgresql/data --config-file=/etc/postgresql/postgresql.conf
command=/usr/lib/postgresql/15/bin/postgres --config-file=/etc/postgresql/15/main/postgresql.conf
autostart=true
autorestart=true
priority=1
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes=0
stderr_logfile=/app/logs/error/postgresql.err.log
stdout_logfile=/app/logs/access/postgresql.log

[program:minio]
directory=/app/data/minio
command=minio server /app/data/minio
autostart=true
autorestart=true
priority=1
stdout_logfile=/app/logs/access/minio.log
stderr_logfile=/app/logs/error/minio.err.log
stdout_logfile=/app/logs/access/minio.log

[program:nginx]
directory=/app/data/nginx
command=/app/nginx-start.sh
autostart=true
autorestart=true
priority=1
stdout_logfile=/app/logs/access/nginx.log
stderr_logfile=/app/logs/error/nginx.err.log
stdout_logfile=/app/logs/access/nginx.log


[program:web]
Expand Down
73 changes: 0 additions & 73 deletions aio/nginx-slim-conf

This file was deleted.

1 change: 0 additions & 1 deletion aio/nginx-full-conf → aio/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ http {
proxy_pass http://localhost:3002/spaces/;
}


location /god-mode/ {
proxy_http_version 1.1;
proxy_set_header Upgrade ${dollar}http_upgrade;
Expand Down
67 changes: 67 additions & 0 deletions aio/supervisord-app
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@

[program:web]
command=/app/aio.sh web
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes=0
environment=PORT=3001,HOSTNAME=0.0.0.0

[program:space]
command=/app/aio.sh space
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes=0
environment=PORT=3002,HOSTNAME=0.0.0.0

[program:admin]
command=/app/aio.sh admin
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes=0
environment=PORT=3003,HOSTNAME=0.0.0.0

[program:migrator]
command=/app/aio.sh migrator
autostart=true
autorestart=false
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes=0

[program:api]
command=/app/aio.sh api
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes=0

[program:worker]
command=/app/aio.sh worker
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes=0

[program:beat]
command=/app/aio.sh beat
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes=0

13 changes: 7 additions & 6 deletions aio/supervisord-full-base
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,37 @@
user=root
nodaemon=true
stderr_logfile=/app/logs/error/supervisor.err.log
stdout_logfile=/app/logs/access/supervisor.out.log
stdout_logfile=/app/logs/access/supervisor.log

[program:redis]
directory=/app/data/redis
command=redis-server
autostart=true
autorestart=true
stderr_logfile=/app/logs/error/redis.err.log
stdout_logfile=/app/logs/access/redis.out.log
stdout_logfile=/app/logs/access/redis.log

[program:postgresql]
user=postgres
command=/usr/lib/postgresql/15/bin/postgres --config-file=/etc/postgresql/15/main/postgresql.conf
autostart=true
autorestart=true
stderr_logfile=/app/logs/error/postgresql.err.log
stdout_logfile=/app/logs/access/postgresql.out.log
stdout_logfile=/app/logs/access/postgresql.log

[program:minio]
directory=/app/data/minio
command=minio server /app/data/minio
autostart=true
autorestart=true
stderr_logfile=/app/logs/error/minio.err.log
stdout_logfile=/app/logs/access/minio.out.log
stdout_logfile=/app/logs/access/minio.log

[program:nginx]
directory=/app/data/nginx
command=/usr/sbin/nginx -g 'daemon off;'
command=/app/nginx-start.sh
autostart=true
autorestart=true
stderr_logfile=/app/logs/error/nginx.err.log
stdout_logfile=/app/logs/access/nginx.out.log
stdout_logfile=/app/logs/access/nginx.log

Loading

0 comments on commit 6a22edd

Please sign in to comment.