mirror of
https://github.com/lemeow125/Borrowing-TrackerBackend.git
synced 2025-04-27 10:11:24 +08:00
Add docker-related files
This commit is contained in:
parent
2dbd9d2690
commit
ad295a0e6d
3 changed files with 96 additions and 0 deletions
30
Dockerfile
Normal file
30
Dockerfile
Normal file
|
@ -0,0 +1,30 @@
|
|||
# Use the official Python 3.11 image
|
||||
# FROM --platform=arm64 python:3.11.4-bookworm
|
||||
# ARG BUILDPLATFORM
|
||||
FROM python:3.11.4-bookworm
|
||||
|
||||
ENV PYTHONBUFFERED 1
|
||||
|
||||
# Create directory
|
||||
RUN mkdir /code
|
||||
|
||||
# Set the working directory to /code
|
||||
WORKDIR /code
|
||||
|
||||
# Mirror the current directory to the working directory for hotreloading
|
||||
ADD . /code/
|
||||
|
||||
# Install pipenv
|
||||
RUN pip install --no-cache-dir -r linux-requirements.txt
|
||||
|
||||
# Make migrations
|
||||
RUN python equipment_tracker/manage.py makemigrations
|
||||
|
||||
# Run custom migrate
|
||||
RUN python equipment_tracker/manage.py migrate
|
||||
|
||||
# Generate DRF Spectacular Documentation
|
||||
RUN python equipment_tracker/manage.py spectacular --color --file stude/schema.yml
|
||||
|
||||
# Expose port 8000 for the web server
|
||||
EXPOSE 8000
|
Loading…
Add table
Add a link
Reference in a new issue