Update Dockerfile

This commit is contained in:
Keannu Bernasol 2024-07-24 18:14:07 +08:00
parent fffe3c7145
commit 30fd8e6027

View file

@ -1,46 +1,46 @@
# Use the official Python 3.11 image # Use the official Python 3.11 image
FROM --platform=arm64 python:3.11.7-bullseye FROM --platform=arm64 python:3.11.9-bookworm
# ARG BUILDPLATFORM # ARG BUILDPLATFORM
# FROM python:3.11.7-bullseye # FROM python:3.11.7-bullseye
ENV PYTHONBUFFERED 1 ENV PYTHONBUFFERED 1
RUN apt-get update RUN apt-get update
# Install necessary dependencies, including cmake # Install necessary dependencies, including cmake
RUN apt-get install -y \ RUN apt-get install -y \
wget \ wget \
tar \ tar \
cmake \ cmake \
proj-bin \ proj-bin \
libgeos-c1v5 \ libgeos-c1v5 \
libproj-dev \ libproj-dev \
libfreexl1 \ libfreexl1 \
libminizip-dev \ libminizip-dev \
libspatialite-dev \ libspatialite-dev \
gdal-bin \ gdal-bin \
libsqlite3-mod-spatialite \ libsqlite3-mod-spatialite \
vim vim
# Create directory # Create directory
RUN mkdir /code RUN mkdir /code
# Set the working directory to /code # Set the working directory to /code
WORKDIR /code WORKDIR /code
# Mirror the current directory to the working directory for hotreloading # Mirror the current directory to the working directory for hotreloading
ADD . /code/ ADD . /code/
# Install pipenv # Install pipenv
RUN pip install --no-cache-dir -r linux-requirements.txt RUN pip install --no-cache-dir -r linux-requirements.txt
# Make migrations # Make migrations
RUN python stude/manage.py makemigrations RUN python stude/manage.py makemigrations
# Run custom migrate # Run custom migrate
RUN python stude/manage.py custom_migrate RUN python stude/manage.py custom_migrate
# Generate DRF Spectacular Documentation # Generate DRF Spectacular Documentation
RUN python stude/manage.py spectacular --color --file stude/schema.yml RUN python stude/manage.py spectacular --color --file stude/schema.yml
# Expose port 8000 for the web server # Expose port 8000 for the web server
EXPOSE 8000 EXPOSE 8000