Skip to content

Commit

Permalink
docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
mexmonjonovuz committed Dec 4, 2024
1 parent 6e09fe6 commit d7f44b2
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 12 deletions.
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
FROM python:3.12-alpine
FROM python:3.11-slim

WORKDIR /app
COPY . /app

COPY . /app
RUN #pip3 install -r requirements.txt

RUN apk add --no-cache gcc musl-dev libffi-dev mariadb-connector-c-dev pkgconfig
RUN --mount=type=cache,id=custom-pip,target=/root/.cache/pip pip install -r requirements.txt

RUN pip install --no-cache-dir -r requirements.txt
#RUN chmod +x entrypoint

EXPOSE 8000
#CMD ["./entrypoint"]

CMD ["python3", "manage.py", "runserver", "0.0.0.0:8000"]
CMD ["python3", "manage.py", "runserver", "0:8000"]
31 changes: 25 additions & 6 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
services:
web_service:
build: .
command: python manage.py runserver 0.0.0.0:8000
django_service:
build:
context: .
dockerfile: ./Dockerfile
command: python3 manage.py runserver 0:8099
ports:
- "8000:8000"
- 8001:8033
volumes:
- .:/app
working_dir: /app
- 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:

0 comments on commit d7f44b2

Please sign in to comment.