| FROM python:3.11-bookworm AS server |
|
|
| ARG USER_ID=1000 |
| ARG GROUP_ID=1000 |
|
|
| ENV DEBIAN_FRONTEND=noninteractive |
| ENV HGPYTHON3=1 |
|
|
| |
| ENV PYTHONUNBUFFERED 1 |
| ENV PYTHONDONTWRITEBYTECODE 1 |
| ENV PYTHONPATH /app |
|
|
| |
| RUN apt-get update \ |
| |
| && apt-get install -y apt-transport-https \ |
| |
| && curl -fsSL https://deb.nodesource.com/setup_24.x | bash - \ |
| |
| && apt-get update \ |
| && apt-get install -y --no-install-recommends \ |
| build-essential \ |
| libmemcached-dev \ |
| nodejs \ |
| postgresql-client \ |
| postgresql-server-dev-15 \ |
| |
| && apt-get autoremove -y |
|
|
| |
| COPY --from=ghcr.io/astral-sh/uv:0.9.0 /uv /bin/uv |
|
|
| WORKDIR /app |
|
|
| |
| COPY requirements/* /app/requirements/ |
| RUN uv pip install --system -r requirements/default.txt -r requirements/dev.txt -r requirements/test.txt -r requirements/lint.txt |
|
|
| |
| RUN groupadd -r --gid=${GROUP_ID} pontoon && useradd --uid=${USER_ID} --no-log-init -r -m -g pontoon pontoon |
| RUN chown -R pontoon:pontoon /app |
| USER pontoon |
|
|
| |
| ENV YUGLIFY_BINARY /app/node_modules/.bin/yuglify |
| ENV TERSER_BINARY /app/node_modules/.bin/terser |
| COPY --chown=pontoon:pontoon pontoon/package.json . |
| RUN npm install |
|
|
| COPY --chown=pontoon:pontoon ./docker/config/server.env .env |
| COPY --chown=pontoon:pontoon . /app/ |
|
|
| RUN python manage.py collectstatic |
|
|
| STOPSIGNAL SIGINT |
| CMD ["/app/docker/server_run.sh"] |
|
|