This repository has been archived by the owner on Sep 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
50 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.git | ||
.gitignore | ||
.github | ||
venv |
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,15 @@ | ||
# Pull base image | ||
FROM python:3.9 | ||
|
||
# Set env variables and work dir | ||
ENV PIP_DISABLE_PIP_VERSION_CHECK 1 | ||
ENV APP_DIR = "/code" | ||
|
||
WORKDIR $APP_DIR | ||
|
||
# Allows docker to cache installed dependencies between builds | ||
COPY ./requirements.txt . | ||
RUN pip install -r requirements.txt | ||
|
||
# Mounts the application code to the image | ||
COPY . . |
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,31 @@ | ||
version: '3.9' | ||
|
||
services: | ||
web: | ||
build: . | ||
ports: | ||
- '8000:8000' | ||
command: python /code/manage.py runserver 0.0.0.0:8000 | ||
volumes: | ||
- .:/code | ||
environment: | ||
DATABASE_NAME: postgres | ||
DATABASE_USER: postgres | ||
DATABASE_PASSWORD: postgres | ||
DATABASE_HOST: db | ||
DATABASE_PORT: 5432 | ||
depends_on: | ||
- db | ||
db: | ||
image: postgres:14 | ||
ports: | ||
- '5432:5432' | ||
volumes: | ||
- postgres_data:/data/db | ||
environment: | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=postgres | ||
- POSTGRES_DB=postgres | ||
|
||
volumes: | ||
postgres_data: {} |