feature/Copying recursively might inadvertently add sensitive data to

the container
This commit is contained in:
Marko Milić 2025-11-14 12:36:31 +01:00
parent 439b972690
commit 36993b64a4
3 changed files with 122 additions and 4 deletions

112
.dockerignore Normal file
View File

@ -0,0 +1,112 @@
# Git files
.git
.gitignore
# Environment and configuration files
.env
.env.*
*.env
apimanager/apimanager/local_settings.py
# IDE and editor files
.idea/
.vscode/
*.swp
*.swo
*~
.DS_Store
API-Manager.iml
# Python cache and build artifacts
__pycache__/
*.pyc
*.pyo
*.pyd
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# Virtual environments
venv/
env/
ENV/
.venv/
# Testing and coverage
.coverage
.pytest_cache/
htmlcov/
.tox/
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
# Logs
*.log
logs/
*.log.*
# Database files
*.db
*.sqlite3
db/
# Temporary files
*.tmp
*.temp
tmp/
temp/
# OS files
Thumbs.db
.DS_Store
# Documentation build
docs/_build/
# Jupyter Notebook
.ipynb_checkpoints
# Node modules (if any)
node_modules/
# Rope project settings
.ropeproject/
# Development and deployment files
docker-compose*.yml
Dockerfile*
.dockerignore
nginx*.conf
supervisor*.conf
*.service
# Backup files
*.bak
*.backup
# Security and certificate files
*.pem
*.key
*.crt
*.cert
*.p12
*.pfx
# Local development files
cookies.txt

View File

@ -1,7 +1,9 @@
FROM python:3.10
COPY . /app
COPY requirements.txt /app/
COPY apimanager/ /app/apimanager/
COPY static/ /app/static/
COPY gunicorn.conf.py /app/gunicorn.conf.py
COPY .github/local_settings_container.py /app/apimanager/apimanager/local_settings.py
COPY .github/gunicorn.conf.py /app/gunicorn.conf.py
RUN pip install -r /app/requirements.txt
WORKDIR /app
RUN ./apimanager/manage.py migrate

View File

@ -21,8 +21,12 @@ RUN pip install --upgrade pip \
&& pip install -r requirements.txt \
&& pip install dj-database-url
# Copy project
COPY . /app/
# Copy project files explicitly
COPY requirements.txt /app/
COPY apimanager/ /app/apimanager/
COPY static/ /app/static/
COPY demo/ /app/demo/
COPY gunicorn.conf.py /app/
# Create necessary directories
RUN mkdir -p /app/logs /app/static /app/db