-
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.
feat: Добавил dockerfile и docker-compose.yml (не доделано)
- Loading branch information
1 parent
ea77329
commit 66b637c
Showing
2 changed files
with
78 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,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 . . | ||
|
||
|
||
|
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,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: |