Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mguptahub committed May 24, 2024
1 parent 58d1f16 commit e7f72ec
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 37 deletions.
18 changes: 13 additions & 5 deletions aio/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,18 @@ ENV PIP_DISABLE_PIP_VERSION_CHECK=1
COPY apiserver/requirements.txt ./api/
COPY apiserver/requirements ./api/requirements

RUN apt-get install python3.12-venv -y
# RUN python3.12 -m pip install --upgrade pip

RUN python3 -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 echo "alias python=/usr/local/bin/python3.12" >> ~/.bashrc && \
# echo "alias pip=/usr/local/bin/pip3.12" >> ~/.bashrc

RUN pip install -r ./api/requirements.txt --compile --no-cache-dir
# RUN apt-get install python3.12-venv -y

# RUN python3 -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

# Add in Django deps and generate Django's static files
COPY apiserver/manage.py ./api/manage.py
Expand All @@ -134,5 +140,7 @@ RUN chown -R app-user:app-user /app

USER app-user

# RUN echo "alias python=/usr/local/bin/python3.12" >> ~/.bashrc && \
# echo "alias pip=/usr/local/bin/pip3.12" >> ~/.bashrc

CMD ["sudo", "/usr/bin/supervisord", "-c", "/app/supervisord.conf"]
10 changes: 9 additions & 1 deletion aio/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ RUN cd /usr/src && \
make altinstall && \
rm -f /usr/src/Python-3.12.0.tgz

RUN python3.12 -m pip install --upgrade pip

RUN echo "alias python=/usr/local/bin/python3.12" >> ~/.bashrc && \
echo "alias pip=/usr/local/bin/pip3.12" >> ~/.bashrc

# Clean up
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /usr/src/Python-3.12.0
Expand All @@ -68,7 +73,7 @@ RUN mkdir -p /app/{data,logs} && \
COPY supervisord.base /app/supervisord.conf

RUN apt-get update && \
apt-get install -y sudo lsof net-tools && \
apt-get install -y sudo lsof net-tools libpq-dev && \
apt-get clean

# Add a new user 'app-user' and give sudo access
Expand All @@ -79,6 +84,9 @@ RUN chown -R app-user:app-user /app

USER app-user

RUN echo "alias python=/usr/local/bin/python3.12" >> ~/.bashrc && \
echo "alias pip=/usr/local/bin/pip3.12" >> ~/.bashrc

# Expose ports for Redis, PostgreSQL, and MinIO
EXPOSE 6379 5432 9000 80

Expand Down
70 changes: 39 additions & 31 deletions aio/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -36,51 +36,59 @@ autorestart=true
stdout_logfile=/app/logs/access/nginx.log
stderr_logfile=/app/logs/error/nginx.err.log

[program:api]
command=/app/api/bin/aio.sh api
autostart=true
autorestart=true
stdout_logfile=/app/logs/access/api.log
stderr_logfile=/app/logs/error/api_err.log

[program:migrator]
command=/app/api/bin/aio.sh migrator
autostart=true
autorestart=false
stdout_logfile=/app/logs/access/migrator.log
stderr_logfile=/app/logs/error/migrator_err.log

[program:worker]
command=/app/api/bin/aio.sh worker
autostart=true
autorestart=true
stdout_logfile=/app/logs/access/worker.log
stderr_logfile=/app/logs/error/worker_err.log

[program:beat]
command=/app/api/bin/aio.sh beat
autostart=true
autorestart=true
stdout_logfile=/app/logs/access/beat.log
stderr_logfile=/app/logs/error/beat_err.log

[program:web]
command=node /app/web/server.js
user=app-user
command=node /app/web/web/server.js
autostart=true
autorestart=true
stdout_logfile=/app/logs/access/web.log
stderr_logfile=/app/logs/error/web_err.log
environment=PORT=3001

[program:space]
command=node /app/space/server.js
user=app-user
command=node /app/space/space/server.js
autostart=true
autorestart=true
stdout_logfile=/app/logs/access/space.log
stderr_logfile=/app/logs/error/space_err.log
environment=PORT=3002

[program:admin]
command=node /app/admin/server.js
user=app-user
command=node /app/admin/admin/server.js
autostart=true
autorestart=true
stdout_logfile=/app/logs/access/admin.log
stderr_logfile=/app/logs/error/admin_err.log
stderr_logfile=/app/logs/error/admin_err.log
environment=PORT=3003

# [program:migrator]
# command=/app/api/bin/aio.sh migrator
# autostart=true
# autorestart=false
# stdout_logfile=/app/logs/access/migrator.log
# stderr_logfile=/app/logs/error/migrator_err.log

# [program:api]
# command=/app/api/bin/aio.sh api
# autostart=true
# autorestart=true
# stdout_logfile=/app/logs/access/api.log
# stderr_logfile=/app/logs/error/api_err.log

# [program:worker]
# command=/app/api/bin/aio.sh worker
# autostart=true
# autorestart=true
# stdout_logfile=/app/logs/access/worker.log
# stderr_logfile=/app/logs/error/worker_err.log

# [program:beat]
# command=/app/api/bin/aio.sh beat
# autostart=true
# autorestart=true
# stdout_logfile=/app/logs/access/beat.log
# stderr_logfile=/app/logs/error/beat_err.log

0 comments on commit e7f72ec

Please sign in to comment.