# FROM python:3.9.9-slim-buster # FROM osgeo/gdal:ubuntu-small-3.4.0 FROM ubuntu:22.04 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 ARG DEBIAN_FRONTEND=noninteractive # Install system dependencies including GDAL RUN apt-get update -y && \ apt-get install -y \ gdal-bin \ libgdal-dev \ python3-gdal \ python3 \ python3-pip \ g++ \ gcc \ postgresql-client \ libpq-dev \ netcat \ postgresql \ binutils \ libproj-dev \ libcurl4-openssl-dev \ libssl-dev \ libspatialindex-dev \ --no-install-recommends && \ apt-get clean -y && \ rm -rf /var/lib/apt/lists/* # 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 install -y \ libreoffice \ libreoffice-calc \ libreoffice-writer \ libreoffice-java-common \ fonts-ipafont \ fonts-ipafont-gothic \ fonts-ipafont-mincho \ language-pack-ja \ fontconfig \ locales \ python3-uno # LibreOffice Python バインディング # 日本語ロケールの設定 RUN locale-gen ja_JP.UTF-8 ENV LANG=ja_JP.UTF-8 ENV LC_ALL=ja_JP.UTF-8 ENV LANGUAGE=ja_JP:ja # フォント設定ファイルをコピー COPY config/fonts.conf /etc/fonts/local.conf # フォントキャッシュの更新 RUN fc-cache -f -v # LibreOfficeの作業ディレクトリを作成 RUN mkdir -p /var/cache/libreoffice && \ chmod 777 /var/cache/libreoffice # フォント設定の権限を設定 RUN chmod 644 /etc/fonts/local.conf # 作業ディレクトリとパーミッションの設定 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 RUN pip install boto3==1.26.137 # 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"]