Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM python:3.10.5-slim

RUN pip install "poetry==1.1.3"

WORKDIR /usr/local/app
COPY poetry.lock pyproject.toml ./

RUN poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi

COPY manage.py ./
COPY ./botc ./botc
COPY ./scripts ./scripts
48 changes: 48 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
version: '3.9'

services:

migrations:
build: .
command: python manage.py migrate
environment:
- DJANGO_SETTINGS=botc.production
- DJANGO_HOST=localhost 127.0.0.1
- DBNAME=postgres
- DBHOST=db
- DBUSER=postgres
- DBPASS=postgres
- SECRET_KEY=botc
depends_on:
- db.postgres.database.azure.com

app:
build: .
command: python manage.py runserver 0.0.0.0:8000
environment:
- DJANGO_SETTINGS=botc.production
- DJANGO_HOST=localhost 127.0.0.1
- DBNAME=postgres
- DBHOST=db
- DBUSER=postgres
- DBPASS=postgres
- SECRET_KEY=botc
ports:
- 8000:8000
depends_on:
- migrations

db.postgres.database.azure.com:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres@db
ports:
- 5432:5432

adminer:
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure this isn't required so I think we can just get rid of it.

image: adminer
restart: always
ports:
- 8080:8080