63 lines
1.8 KiB
Docker
63 lines
1.8 KiB
Docker
FROM node:20-alpine AS frontend-build
|
|
|
|
WORKDIR /frontend
|
|
COPY frontend/package.json frontend/package-lock.json* ./
|
|
RUN npm install
|
|
COPY frontend/ ./
|
|
RUN npm run build
|
|
|
|
FROM postgres:16-bookworm AS runtime
|
|
|
|
ENV GEOINTEL_ENV=production \
|
|
GEOINTEL_API_PREFIX=/api/v1 \
|
|
GEOINTEL_STORAGE_ROOT=/app/storage \
|
|
STORAGE_ROOT=/app/storage \
|
|
GEOINTEL_POSTGRES_DB=geointel \
|
|
GEOINTEL_POSTGRES_USER=geointel \
|
|
GEOINTEL_POSTGRES_PASSWORD=geointel \
|
|
GEOINTEL_ALL_IN_ONE=1 \
|
|
PATH="/opt/geointel/venv/bin:${PATH}"
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
build-essential \
|
|
curl \
|
|
gdal-bin \
|
|
libgdal-dev \
|
|
libgeos-dev \
|
|
libpq-dev \
|
|
libproj-dev \
|
|
nginx \
|
|
postgresql-16-postgis-3 \
|
|
postgresql-16-postgis-3-scripts \
|
|
proj-bin \
|
|
python3-dev \
|
|
python3-venv \
|
|
&& ln -sf /usr/bin/python3.11 /usr/local/bin/python3 \
|
|
&& ln -sf /usr/bin/python3.11 /usr/bin/python3 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
COPY backend/ /app/
|
|
COPY fixtures/ /app/fixtures/
|
|
COPY deploy/unraid/nginx-all-in-one.conf /etc/nginx/conf.d/default.conf
|
|
COPY deploy/unraid/all-in-one-start.sh /usr/local/bin/geointel-all-in-one-start
|
|
COPY --from=frontend-build /frontend/dist/ /usr/share/nginx/html/
|
|
|
|
RUN /usr/bin/python3.11 -m venv /opt/geointel/venv \
|
|
&& pip install --no-cache-dir --upgrade pip setuptools \
|
|
&& pip install --no-cache-dir ".[gis]" \
|
|
&& python scripts/gis_import_smoke.py \
|
|
&& chmod +x /usr/local/bin/geointel-all-in-one-start \
|
|
&& rm -f /etc/nginx/sites-enabled/default \
|
|
&& mkdir -p /app/storage /run/nginx /var/log/nginx
|
|
|
|
VOLUME ["/var/lib/postgresql/data", "/app/storage"]
|
|
|
|
EXPOSE 80
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --retries=10 --start-period=60s \
|
|
CMD curl -fsS http://127.0.0.1/health >/dev/null || exit 1
|
|
|
|
CMD ["/usr/local/bin/geointel-all-in-one-start"]
|