generated from SverreNystad/template_python_application
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into structure-architecture
- Loading branch information
Showing
7 changed files
with
135 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Use the official Python image from the Docker Hub | ||
FROM python:3.11.2 | ||
|
||
# Make a new directory to put our code in. | ||
RUN mkdir /code | ||
|
||
# Change the working directory. | ||
WORKDIR /code | ||
|
||
# Copy only the requirements first | ||
COPY requirements.txt /code/ | ||
RUN pip install -r requirements.txt | ||
|
||
# Then copy the rest of the code | ||
COPY . /code/ | ||
|
||
# Run the application: | ||
CMD gunicorn --bind :8000 tutorai.wsgi --workers 1 --timeout 120 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
version: '3.8' | ||
|
||
services: | ||
tutorai: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
command: python manage.py runserver 0.0.0.0:8000 | ||
volumes: | ||
- .:/code | ||
ports: | ||
- "8000:8000" | ||
depends_on: | ||
- db | ||
environment: | ||
- DEBUG=True | ||
- DATABASE_HOST=db | ||
- DDATABSE_PORT=5432 | ||
- DATABASE_NAME=tutoraidb | ||
- DATABASE_USER=tutoraiuser | ||
- DATABASE_PASSWORD=tutoraipassword | ||
|
||
db: | ||
image: postgres:13 | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data | ||
environment: | ||
- POSTGRES_DB=tutoraidb | ||
- POSTGRES_USER=tutoraiuser | ||
- POSTGRES_PASSWORD=tutoraipassword | ||
|
||
volumes: | ||
postgres_data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters