Skip to content

Commit

Permalink
docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
mexmonjonovuz committed Dec 5, 2024
1 parent d7f44b2 commit 9aa7e76
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 29 deletions.
10 changes: 4 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ FROM python:3.11-slim
WORKDIR /app
COPY . /app

RUN #pip3 install -r requirements.txt
#RUN #pip3 install -r requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

RUN --mount=type=cache,id=custom-pip,target=/root/.cache/pip pip install -r requirements.txt

#RUN chmod +x entrypoint

#CMD ["./entrypoint"]
#RUN pip install --upgrade pip
#RUN --mount=type=cache,id=custom-pip,target=/root/.cache/pip pip install -r requirements.txt

CMD ["python3", "manage.py", "runserver", "0:8000"]
27 changes: 4 additions & 23 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,9 @@
services:
django_service:
alijahon_service:
build:
context: .
dockerfile: ./Dockerfile
command: python3 manage.py runserver 0:8099
command:
- bash -c "python manage.py makemigrations && python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
ports:
- 8001:8033
volumes:
- static_volume:/app/static
- media_volume:/app/media
env_file: .env
depends_on:
- mysql_service

mysql_service:
image: mysql:alpine
environment:
- MYSQL_PASSWORD=1
ports:
- 5433:5432
volumes:
- new_pg_data:/var/lib/mysql/data

volumes:
new_pg_data:
static_volume:
media_volume:
- 8000:8000

0 comments on commit 9aa7e76

Please sign in to comment.