[FIX] DOCKER: Issue with creating migration file for auth user model

This commit is contained in:
Horilla
2025-10-29 12:59:38 +05:30
parent e138534ce5
commit 345ef52aa2
2 changed files with 6 additions and 5 deletions

View File

@@ -55,11 +55,11 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# Create non-root user
# Create non-root user FIRST
RUN useradd --create-home --uid 1000 appuser
# Copy virtual environment from builder stage
COPY --from=builder /opt/venv /opt/venv
# Copy virtual environment from builder stage WITH correct ownership
COPY --from=builder --chown=appuser:appuser /opt/venv /opt/venv
WORKDIR /app
@@ -82,4 +82,4 @@ HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8000/health/ || exit 1
ENTRYPOINT ["/entrypoint.sh"]
CMD ["gunicorn", "horilla.wsgi:application", "--config", "docker/gunicorn.conf.py"]
CMD ["gunicorn", "horilla.wsgi:application", "--config", "docker/gunicorn.conf.py"]

View File

@@ -11,10 +11,11 @@ done
echo "PostgreSQL is ready!"
# Run migrations
python manage.py makemigrations
python manage.py migrate --noinput
# Collect static files
python manage.py collectstatic --noinput
echo "Starting server..."
exec "$@"
exec "$@"