Skip to content

Commit

Permalink
feat: Добавил dockerfile и docker-compose.yml (не доделано)
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonVagabond committed Mar 5, 2024
1 parent ea77329 commit 66b637c
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM python:3.11-alpine

WORKDIR /usr/src/app

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

RUN pip install --upgrade pip
COPY ./requirements.txt .

RUN \
apk add --no-cache make && \
apk add --no-cache postgresql-libs && \
apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev && \
python3 -m pip install -r requirements.txt --no-cache-dir && \
apk --purge del .build-deps

COPY . .



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

services:

db:
image: postgres:14-alpine
container_name: db
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
- POSTGRES_USER=${PG_USER}
- POSTGRES_PASSWORD=${PG_PASSWORD}
- POSTGRES_DB=${PG_DATABASE}

redis:
image: redis:latest
container_name: redis


rabbitmq:
image: rabbitmq:latest
container_name: rabbitmq

celery:
restart: always
build:
context: ./
command: celery -A online_store worker -l INFO
volumes:
- ./:/usr/src/app/
container_name: celery
depends_on:
- db
- redis
- rabbitmq
- web

web:
build: ./
command: python manage.py runserver 0.0.0.0:8000
container_name: online_store
volumes:
- ./:/usr/src/app/
- /var/www/back/static/:/usr/src/app/static/
- /var/www/back/media/:/usr/src/app/media/
ports:
- "8000:8000"
env_file:
- ./.env
depends_on:
- db
- redis
- rabbitmq
- celery

volumes:
postgres_data:

0 comments on commit 66b637c

Please sign in to comment.