Skip to content

Commit

Permalink
docker added
Browse files Browse the repository at this point in the history
  • Loading branch information
krishna-shah-07 committed Jan 3, 2025
1 parent 5de890e commit 0880fcc
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ignore

__pycache__
*.pyc
*.pyo
*.pyd
*.db
*.sqlite3
*.log
*.pot
*.mo
*.swp
*.swo
*.DS_Store
.env
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Use the official Python image from the Docker Hub
FROM python:3.10-slim

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# Set the working directory
WORKDIR /app

# Copy the requirements file into the container
COPY requirements.txt /app/

# Install the dependencies
RUN pip install -r requirements.txt

# Copy the rest of the application code into the container
COPY . /app/

# Expose the port the app runs on
EXPOSE 8000

# Run the Django development server
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
24 changes: 24 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: '3.8'

services:
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/app
ports:
- "8000:8000"
depends_on:
- db

db:
image: postgres:13
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_DB: your_db_name
POSTGRES_USER: your_db_user
POSTGRES_PASSWORD: your_db_password

volumes:
postgres_data:
Binary file modified requirements.txt
Binary file not shown.

0 comments on commit 0880fcc

Please sign in to comment.