add backend and docker files

This commit is contained in:
Allen
2023-09-23 10:16:49 -05:00
parent ca5eeb3e7b
commit 044579b0d4
12 changed files with 254 additions and 0 deletions

28
backend/django/Dockerfile Normal file
View File

@ -0,0 +1,28 @@
# base image
FROM python:3.8
# setup environment variable
ENV DockerHOME=/home/app/webapp
# set work directory
RUN mkdir -p $DockerHOME
# where your code lives
WORKDIR $DockerHOME
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# install dependencies
RUN pip install --upgrade pip
# copy whole project to your docker home directory.
# COPY . $DockerHOME
COPY ./requirements.txt $DockerHOME
# Don't need to copy entire project directory, just use a docker volume with a local path
# run this command to install all dependencies
RUN pip install -r requirements.txt
# port where the Django app runs
EXPOSE 8000
# start server
CMD python seatstock_django/manage.py runserver