First commit

This commit is contained in:
2024-08-22 20:25:59 +01:00
commit 1b5d90122c
3 changed files with 68 additions and 0 deletions

18
.devcontainer/Dockerfile Normal file
View File

@@ -0,0 +1,18 @@
# Use the official Python image.
# More info: https://hub.docker.com/_/python
FROM python:3.11-slim
# Set up the container for Python development
WORKDIR /workspace
COPY requirements.txt /workspace
# Install Python dependencies
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
# Install additional packages if needed
# RUN apt-get update && apt-get install -y <package_name>
# Expose port 8000 to access Django
EXPOSE 8000

View File

@@ -0,0 +1,21 @@
i{
"name": "Django DevContainer",
"dockerComposeFile": "docker-compose.yml",
"service": "web",
"workspaceFolder": "/workspace",
"settings": {
"terminal.integrated.defaultProfile.linux": "/bin/bash",
"python.pythonPath": "/usr/local/bin/python"
},
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.flake8"
],
"postCreateCommand": "pip install -r requirements.txt",
"forwardPorts": [8000],
"remoteEnv": {
"DJANGO_SETTINGS_MODULE": "myproject.settings"
}
}

View File

@@ -0,0 +1,29 @@
version: '3.7'
services:
web:
build:
context: .
dockerfile: Dockerfile
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/workspace
ports:
- "8000:8000"
depends_on:
- db
environment:
- DJANGO_SETTINGS_MODULE=bookings_app.settings
db:
image: postgres:13
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: mydatabase
volumes:
- pgdata:/var/lib/postgresql/data
volumes:
pgdata: