2023-08-03 23:21:47 +08:00
|
|
|
# Use the official Python 3.11 image
|
2023-08-20 20:59:36 +08:00
|
|
|
# FROM --platform=arm64 python:3.11.4-bookworm
|
2023-08-03 23:21:47 +08:00
|
|
|
FROM python:3.11.4-bookworm
|
|
|
|
|
|
|
|
ENV PYTHONBUFFERED 1
|
|
|
|
|
|
|
|
# Install necessary dependencies, including cmake
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
wget \
|
|
|
|
tar \
|
|
|
|
cmake \
|
|
|
|
proj-bin \
|
|
|
|
libgeos-c1v5 \
|
|
|
|
libproj-dev \
|
|
|
|
libfreexl1 \
|
|
|
|
libminizip-dev \
|
|
|
|
libspatialite-dev \
|
|
|
|
gdal-bin \
|
|
|
|
libsqlite3-mod-spatialite
|
|
|
|
|
2023-09-12 19:26:37 +08:00
|
|
|
# Create directory
|
|
|
|
RUN mkdir /code
|
2023-08-03 23:21:47 +08:00
|
|
|
|
2023-09-12 19:26:37 +08:00
|
|
|
# Set the working directory to /code
|
|
|
|
WORKDIR /code
|
|
|
|
|
|
|
|
# Mirror the current directory to the working directory for hotreloading
|
|
|
|
ADD . /code/
|
2023-08-03 23:21:47 +08:00
|
|
|
|
|
|
|
# Install pipenv
|
|
|
|
RUN pip install -r linux-requirements.txt
|
|
|
|
|
|
|
|
# Make migrations
|
|
|
|
RUN python stude/manage.py makemigrations
|
|
|
|
|
|
|
|
# Run custom migrate
|
|
|
|
RUN python stude/manage.py custom_migrate
|
|
|
|
|
|
|
|
# Expose port 8000 for the web server
|
|
|
|
EXPOSE 8000
|