-
Notifications
You must be signed in to change notification settings - Fork 3
Docker-compose setup #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| FROM python:3.11-slim | ||
|
|
||
| ENV PYTHONDONTWRITEBYTECODE=1 \ | ||
| PYTHONUNBUFFERED=1 | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| RUN apt-get update && apt-get install -y \ | ||
| build-essential \ | ||
| libpq-dev \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| COPY requirements.txt . | ||
| RUN pip install --upgrade pip | ||
| RUN pip install -r requirements.txt | ||
|
|
||
| COPY . . | ||
|
|
||
| COPY entrypoint.sh /entrypoint.sh | ||
| RUN chmod +x /entrypoint.sh | ||
|
|
||
| ENTRYPOINT ["/entrypoint.sh"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| version: '3.9' | ||
|
|
||
| services: | ||
| django-app: | ||
| build: . | ||
| container_name: django_app | ||
| ports: | ||
| - "${PORT:-8000}:8000" | ||
| env_file: | ||
| - ./warehouse_managment/warehouse_managment/.env | ||
| volumes: | ||
| - .:/app | ||
| working_dir: /app/warehouse_managment | ||
| restart: unless-stopped | ||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,10 @@ | ||||||||||||
| #!/bin/sh | ||||||||||||
|
|
||||||||||||
| echo "⚙️ Applying migrations..." | ||||||||||||
| python manage.py migrate | ||||||||||||
|
|
||||||||||||
| echo "📦 PORT from .env is: $PORT" | ||||||||||||
|
|
||||||||||||
| PORT=${PORT:-8000} | ||||||||||||
|
Comment on lines
+6
to
+8
|
||||||||||||
| echo "📦 PORT from .env is: $PORT" | |
| PORT=${PORT:-8000} | |
| PORT=${PORT:-8000} | |
| echo "📦 PORT from .env is: $PORT" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| PORT=8003 |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,12 @@ | ||||||||||
| # Django | ||||||||||
| DJANGO_SECRET_KEY=your-secret-key-here | ||||||||||
| DJANGO_DEBUG=True | ||||||||||
| DJANGO_ALLOWED_HOSTS=localhost,127.0.0.1 | ||||||||||
|
|
||||||||||
|
||||||||||
| # Uncomment the following lines to configure a Postgres database connection. | |
| # These settings are used if DATABASE_URL is not provided or if the application explicitly supports them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docker-compose.yaml references './warehouse_managment/warehouse_managment/.env', but the added file is '.env.example'. This mismatch may cause missing environment variables at runtime. Consider updating the file reference or renaming the file accordingly.