Skip to content

Commit

Permalink
docker and docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
mamazinho committed Jun 14, 2021
1 parent e76e5f0 commit 647e135
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM python

WORKDIR /var/www

COPY poetry.lock pyproject.toml ./

RUN pip install poetry
RUN poetry config virtualenvs.create false
RUN poetry install

COPY . .
25 changes: 25 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: '3.9'

services:
pg_channel_tmp:
image: postgres
env_file: .env
healthcheck:
test: ["CMD", "pg_isready", "-U", "$POSTGRES_USER", "-d", "$POSTGRES_DB"]
retries: 3
interval: 3s
timeout: 3s
restart: always

django_channel_tmp:
build: ./
env_file: .env
ports:
- 3000:3000
volumes:
- ./:/var/www
depends_on:
pg_channel_tmp:
condition: service_healthy

command: ./run.sh
4 changes: 4 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
`python manage.py makemigrations`
`python manage.py migrate`
`python manage.py test`
`python manage.py runserver 0:3000`

0 comments on commit 647e135

Please sign in to comment.