Skip to content
Snippets Groups Projects
Commit 6689df7d authored by Mohammad Torkashvand's avatar Mohammad Torkashvand
Browse files

Add environment variables for Python logging and UTF-8 support in Alpine image

parent a14fa02e
No related branches found
No related tags found
1 merge request!331Add environment variables for Python logging and UTF-8 support in Alpine image
Pipeline #90995 passed
FROM python:3.12.7-alpine FROM python:3.12.7-alpine
WORKDIR /app WORKDIR /app
# Set environment variables for predictable Python behavior and UTF-8 encoding
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
LANG=C.UTF-8 \
LC_ALL=C.UTF-8
ARG ARTIFACT_VERSION ARG ARTIFACT_VERSION
RUN apk add --no-cache gcc libc-dev libffi-dev curl vim && \ RUN apk add --no-cache gcc libc-dev libffi-dev curl vim && \
addgroup -S appgroup && adduser -S appuser -G appgroup -h /app addgroup -S appgroup && adduser -S appuser -G appgroup -h /app
RUN pip install \ RUN pip install --no-cache-dir \
--pre \ --pre \
--trusted-host 150.254.211.2 \ --trusted-host 150.254.211.2 \
--extra-index-url https://150.254.211.2/artifactory/api/pypi/geant-swd-pypi/simple \ --extra-index-url https://150.254.211.2/artifactory/api/pypi/geant-swd-pypi/simple \
...@@ -19,7 +25,7 @@ ENV TRANSLATIONS_DIR=/app/gso/translations/ ...@@ -19,7 +25,7 @@ ENV TRANSLATIONS_DIR=/app/gso/translations/
# Copy the shell scripts and ensure scripts do not have Windows line endings and make them executable # Copy the shell scripts and ensure scripts do not have Windows line endings and make them executable
COPY start-app.sh start-worker.sh start-scheduler.sh /app/ COPY start-app.sh start-worker.sh start-scheduler.sh /app/
RUN sed -i 's/\r$//' start-app.sh start-worker.sh start-scheduler.sh && \ RUN sed -i 's/\r$//' start-app.sh start-worker.sh start-scheduler.sh && \
chmod 755 start-app.sh start-worker.sh start-scheduler.sh chmod +x start-app.sh start-worker.sh start-scheduler.sh
RUN chown -R appuser:appgroup /app RUN chown -R appuser:appgroup /app
USER appuser USER appuser
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment