tools: add etesync server container image build config for production

master
alex 1 year ago
parent 46f165b3e3
commit bc01714dc1

@ -0,0 +1,4 @@
#!/bin/sh
TAG="${1:-eteserver}"
TOOLS_DIR="$(dirname "$0")"
exec podman build -t "${TAG}" -f "${TOOLS_DIR}/server.containerfile" "${TOOLS_DIR}/../server"

@ -0,0 +1,30 @@
FROM python:3.11-alpine
ENV PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_NO_CACHE_DIR=1 \
PIP_ROOT_USER_ACTION=ignore
# install system pkg deps
RUN apk add libpq postgresql-dev --virtual .build-deps coreutils gcc libc-dev libffi-dev make
COPY etebase_server/ /app/etebase_server/
COPY requirements.txt manage.py /app/
WORKDIR /app
# 1. install app pip requirements
# 2. generate static files
# 3. cleanup
RUN pip install -U pip && \
pip install --no-cache-dir --progress-bar off -r ./requirements.txt && \
pip install --no-cache-dir --progress-bar off psycopg2==2.9.6 && \
\
python manage.py collectstatic --noinput && \
\
apk del .build-deps make gcc coreutils && \
apk add libpq && \
rm -rf /root/.cache
ENV ETEBASE_EASY_CONFIG_PATH=/app/server.conf
VOLUME /data
ENTRYPOINT ["uvicorn", "etebase_server.asgi:application"]
Loading…
Cancel
Save