88 lines
2.1 KiB
Docker
88 lines
2.1 KiB
Docker
# FROM python:3.9.9-slim-buster
|
|
FROM osgeo/gdal:ubuntu-small-3.4.0
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
LABEL maintainer="nouffer@gmail.com"
|
|
LABEL description="Development image for the Rogaining JP"
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE 1
|
|
ENV PYTHONUNBUFFERED 1
|
|
|
|
ARG TZ Asia/Tokyo \
|
|
DEBIAN_FRONTEND=noninteractive
|
|
|
|
RUN apt-get update -y
|
|
|
|
# Install GDAL dependencies
|
|
RUN apt-get install -y libgdal-dev g++ --no-install-recommends && \
|
|
apt-get clean -y
|
|
|
|
# Update C env vars so compiler can find gdal
|
|
ENV CPLUS_INCLUDE_PATH=/usr/include/gdal
|
|
ENV C_INCLUDE_PATH=/usr/include/gdal
|
|
|
|
RUN apt-get update \
|
|
&& apt-get -y install netcat gcc postgresql \
|
|
&& apt-get clean
|
|
|
|
RUN apt-get update \
|
|
&& apt-get install -y binutils libproj-dev gdal-bin python3-gdal
|
|
|
|
RUN apt-get install -y libcurl4-openssl-dev libssl-dev
|
|
|
|
RUN apt-get install -y libspatialindex-dev
|
|
|
|
RUN apt-get install -y python3
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
python3-pip
|
|
|
|
# ベースイメージの更新とパッケージのインストール
|
|
RUN apt-get update && \
|
|
apt-get install -y \
|
|
libreoffice \
|
|
libreoffice-calc \
|
|
libreoffice-writer \
|
|
python3-uno # LibreOffice Python バインディング
|
|
|
|
# 作業ディレクトリとパーミッションの設定
|
|
RUN mkdir -p /app/docbase /tmp/libreoffice && \
|
|
chmod -R 777 /app/docbase /tmp/libreoffice
|
|
|
|
|
|
RUN pip install --upgrade pip
|
|
|
|
# Copy the package directory first
|
|
COPY SumasenLibs/excel_lib /app/SumasenLibs/excel_lib
|
|
COPY ./docbase /app/docbase
|
|
|
|
# Install the package in editable mode
|
|
RUN pip install -e /app/SumasenLibs/excel_lib
|
|
|
|
|
|
RUN apt-get update
|
|
|
|
COPY ./requirements.txt /app/requirements.txt
|
|
|
|
# Install Gunicorn
|
|
RUN pip install gunicorn
|
|
|
|
#COPY ./wait-for.sh .
|
|
|
|
#RUN ["chmod", "+x", "wait-for.sh"]
|
|
|
|
# xlsxwriterを追加
|
|
RUN pip install -r requirements.txt \
|
|
&& pip install django-cors-headers \
|
|
&& pip install xlsxwriter gunicorn
|
|
|
|
COPY . /app
|
|
|
|
# Collect static files
|
|
RUN python manage.py collectstatic --noinput
|
|
|
|
# Use Gunicorn as the entrypoint
|
|
CMD ["gunicorn", "config.wsgi:application", "--bind", "0.0.0.0:8000"]
|