mirror of
https://github.com/lemeow125/DRF_Template.git
synced 2025-04-28 02:31:15 +08:00
Initial commit
This commit is contained in:
commit
0ad426398a
25 changed files with 2648 additions and 0 deletions
28
Dockerfile
Normal file
28
Dockerfile
Normal file
|
@ -0,0 +1,28 @@
|
|||
ARG DOCKER_PLATFORM=$TARGETPLATFORM
|
||||
FROM --platform=$DOCKER_PLATFORM 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 requirements.txt
|
||||
|
||||
# Make migrations
|
||||
RUN python backend/manage.py makemigrations
|
||||
|
||||
# Run custom migrate
|
||||
RUN python backend/manage.py migrate
|
||||
|
||||
# Generate DRF Spectacular Documentation
|
||||
RUN python backend/manage.py spectacular --color --file backend/schema.yml
|
||||
|
||||
# Expose port 8000 for the web server
|
||||
EXPOSE 8000
|
Loading…
Add table
Add a link
Reference in a new issue