update compose for monorepo
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 28s

This commit is contained in:
2026-08-02 05:10:30 +05:00
parent c56140011f
commit 4bf75fdfe4
8 changed files with 47 additions and 114 deletions
+13
View File
@@ -0,0 +1,13 @@
FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
WORKDIR /app
# Source is bind-mounted at runtime; (re)install deps on start so
# requirements.txt changes are picked up without a rebuild, then run the
# Django autoreloading dev server.
CMD pip install --no-cache-dir -r requirements.txt \
&& python manage.py migrate \
&& python manage.py runserver 0.0.0.0:5000
-13
View File
@@ -1,13 +0,0 @@
FROM python:3.11.4-slim-buster
WORKDIR /var/www/html/
COPY . .
RUN pip install -r requirements.txt
RUN python3 manage.py collectstatic
VOLUME /var/www/html/staticfiles/
CMD gunicorn apibase.wsgi:application --bind 0.0.0.0:5000 --workers=4
-13
View File
@@ -1,13 +0,0 @@
services:
api:
build:
context: ../../
dockerfile: .build/prod/api.Dockerfile
hostname: sarlink-portal-api
image: git.shihaam.dev/sarlink/sarlink-portal-api/api
nginx:
build:
context: .
dockerfile: ./nginx.Dockerfile
hostname: sarlink-portal-api-nginx
image: git.shihaam.dev/sarlink/sarlink-portal-api/nginx
-14
View File
@@ -1,14 +0,0 @@
#!/bin/sh
if [ "$DATABASE" = "postgres" ]
then
echo "Waiting for postgres..."
while ! nc -z $POSTGRES_HOST $POSTGRES_PORT; do
sleep 0.1
done
echo "PostgreSQL started"
fi
exec "$@"
-11
View File
@@ -1,11 +0,0 @@
FROM nginx
# Install basic tools
RUN apt update \
&& apt install curl nano iputils-ping zip unzip -y --no-install-recommends \
&& apt auto-remove -y \
&& apt clean -y
COPY nginx.conf /etc/nginx/conf.d/default.conf
WORKDIR /etc/nginx
-26
View File
@@ -1,26 +0,0 @@
server {
listen 80;
server_name _;
access_log /dev/stdout;
error_log /dev/stdout info;
# Serve static files
location /static/ {
alias /var/www/html/staticfiles/;
}
location /media/ {
alias /var/www/html/media/;
}
# Forward requests to Gunicorn
location / {
proxy_pass http://portal-api:5000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 6M;
}
}