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
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ MONGODB_USER=myapp_user
MONGODB_PASSWORD=secure_password

MONGODB_DATABASE=myapp_dev
GITHUB_USER=my_github_user
GITHUB_TOKEN=my_github_token
4 changes: 1 addition & 3 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ name: Docker Image CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

persmissions:
permissions:
packages: write

jobs:
Expand Down
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ services:
- app-network-prod

app-prod:
image: ghcr.io/ajayposhak/url-shortener:latest
build:
context: .
dockerfile: Dockerfile
Expand Down Expand Up @@ -110,6 +111,17 @@ services:
app: "url-shortener"
environment: "production"

watchtower: # Automatically update containers
image: containrrr/watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: --debug --include-restarting
environment:
- WATCHTOWER_CLEANUP=true
- WATCHTOWER_SCHEDULE=0 */30 * * * * # Run every half an hour
- GITHUB_USER=${GITHUB_USER}
- GITHUB_TOKEN=${GITHUB_TOKEN}

volumes:
mongodb-data-prod:

Expand Down