Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Version control
.git
.github

# Secrets / local data
.env
.env.example
db.sqlite3

# Local virtualenv
venv
.venv
env
ENV

# Python artifacts
__pycache__
*.py[cod]
*.egg-info
.pytest_cache
.ruff_cache
.mypy_cache
.coverage
htmlcov

# User-uploaded content (mounted as a volume at runtime)
media

# Editor / tooling
.idea
.vscode
.pre-commit-config.yaml

# Docs, not needed at runtime
docs
README.md
LICENSE
18 changes: 6 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,10 @@ jobs:
run: |
mkdir -p ~/.ssh
ssh-keyscan -H ${{ secrets.SERVER_DEV }} >> ~/.ssh/known_hosts
- name: Deploy code via rsync
- name: Sync compose.yaml to server
run: |
rsync -az --delete \
--exclude=".git" \
--exclude=".github" \
--exclude=".env" \
./ ${{ secrets.SERVER_USER_DEV }}@${{ secrets.SERVER_DEV }}:${{ secrets.LOCATION_DEV }}
rsync -az compose.yaml \
${{ secrets.SERVER_USER_DEV }}@${{ secrets.SERVER_DEV }}:${{ secrets.LOCATION_DEV }}/compose.yaml
- name: Pull image and restart Docker Compose
run: |
ssh ${{ secrets.SERVER_USER_DEV }}@${{ secrets.SERVER_DEV }} << 'EOF'
Expand Down Expand Up @@ -130,13 +127,10 @@ jobs:
run: |
mkdir -p ~/.ssh
ssh-keyscan -H ${{ secrets.SERVER }} >> ~/.ssh/known_hosts
- name: Deploy code via rsync
- name: Sync compose.yaml to server
run: |
rsync -az --delete \
--exclude=".git" \
--exclude=".github" \
--exclude=".env" \
./ ${{ secrets.SERVER_USER }}@${{ secrets.SERVER }}:${{ secrets.LOCATION }}
rsync -az compose.yaml \
${{ secrets.SERVER_USER }}@${{ secrets.SERVER }}:${{ secrets.LOCATION }}/compose.yaml
- name: Pull image and restart Docker Compose
run: |
ssh ${{ secrets.SERVER_USER }}@${{ secrets.SERVER }} << 'EOF'
Expand Down
11 changes: 2 additions & 9 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,8 @@ services:
- ${SERVER_STATIC_ROOT}:/app/staticfiles
- ${SERVER_MEDIA_ROOT}:/app/media
- ${SOCKET_DIR}:/run/sockets
environment:
- DEBUG=${DEBUG}
- SECRET_KEY=${SECRET_KEY}
- DB_NAME=${DB_NAME}
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_HOST=${DB_HOST}
- DB_PORT=${DB_PORT}
- ALLOWED_HOSTS=${ALLOWED_HOSTS}
env_file:
- .env
depends_on:
- db
restart: unless-stopped
Expand Down
Loading