This application is developed in python using Django as framework. The only use it has is to serve as an example for testing with the SRE tools in the repository:
https://github.com/diazalonsodavid/app-project-devops
- Python 3.x
- Docker
-
Clone the repository git clone https://github.com/diazalonsodavid/App-Project
-
Build the Docker image docker build -t app-project .
-
Run the Docker container docker run -p 80:5005 project_name
-
Visit http://localhost in your web browser to access the application
For the correct functioning of the application it will be necessary to connect to a MySQL server whose parameters are set in the settings.py file located in core/settings.py
FROM python:3.9
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Set the default workdir
WORKDIR /usr/src/app
COPY requirements.txt .
# install python dependencies
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 5005
# running migrations (with mysql required to execute migration manually)
# RUN python manage.py migrate
# gunicorn
CMD ["gunicorn", "--config", "gunicorn-cfg.py", "core.wsgi"]