Files
rogaining_srv/Dockerfile.gdal

125 lines
3.0 KiB
Docker
Raw Normal View History

2022-03-14 10:50:11 +05:30
# FROM python:3.9.9-slim-buster
FROM osgeo/gdal:ubuntu-small-3.4.0
WORKDIR /app
2024-11-08 04:30:58 +00:00
2022-03-14 10:50:11 +05:30
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
2025-08-20 19:15:19 +09:00
# libpqをアップグレード Added by Akira 2025-5-13
RUN apt-get update && apt-get install -y \
postgresql-client \
libpq-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
2024-11-08 04:30:58 +00:00
# ベースイメージの更新とパッケージのインストール
RUN apt-get update && \
apt-get install -y \
libreoffice \
libreoffice-calc \
libreoffice-writer \
2024-11-09 09:50:58 +00:00
libreoffice-java-common \
fonts-ipafont \
fonts-ipafont-gothic \
fonts-ipafont-mincho \
language-pack-ja \
fontconfig \
locales \
2024-11-08 04:30:58 +00:00
python3-uno # LibreOffice Python バインディング
2024-11-09 09:50:58 +00:00
# 日本語ロケールの設定
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
2024-11-08 04:30:58 +00:00
# 作業ディレクトリとパーミッションの設定
RUN mkdir -p /app/docbase /tmp/libreoffice && \
chmod -R 777 /app/docbase /tmp/libreoffice
2022-03-14 10:50:11 +05:30
RUN pip install --upgrade pip
2024-11-08 04:30:58 +00:00
# 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
2022-03-14 10:50:11 +05:30
RUN apt-get update
COPY ./requirements.txt /app/requirements.txt
2024-11-09 09:50:58 +00:00
RUN pip install boto3==1.26.137
2023-05-25 22:41:41 +05:30
# Install Gunicorn
RUN pip install gunicorn
2022-11-05 14:31:55 +05:30
#COPY ./wait-for.sh .
#RUN ["chmod", "+x", "wait-for.sh"]
2024-10-28 02:20:28 +00:00
# xlsxwriterを追加
RUN pip install -r requirements.txt \
2024-10-28 20:25:05 +00:00
&& pip install django-cors-headers \
2024-10-28 02:20:28 +00:00
&& pip install xlsxwriter gunicorn
2022-03-14 10:50:11 +05:30
COPY . /app
2023-05-25 22:41:41 +05:30
# 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"]