Files
git/compose.dev.yml
Max 23cf397581 S3 Data Storage (#1)
Using the storage options [here](https://docs.gitea.com/administration/config-cheat-sheet#storage-storage), this commit pushes all packages, avatars, and LFS files to S3.

- Uses AWS S3.
- Frees up storage on EC2 instance, so packages do not eventually steal all of the free space.

Reviewed-on: #1
Co-authored-by: Max <git@maximhutz.me>
Co-committed-by: Max <git@maximhutz.me>
2025-02-19 06:02:46 +00:00

72 lines
1.7 KiB
YAML

name: web-git
services:
# Gitea itself.
gitea:
container_name: web-git-instance
restart: unless-stopped
depends_on:
- backup
- bucket-script
build:
context: gitea
dockerfile: Dockerfile.dev
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- data:/var/lib/gitea
ports:
- 80:80
- 443:443
- 3000:3000
- 2222:2222
labels:
- docker-volume-backup.stop-during-backup=true
# The back-up service.
backup:
container_name: web-git-backup
image: offen/docker-volume-backup:v2
depends_on:
- bucket-script
volumes:
- data:/backup/my-app-backup:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
AWS_ENDPOINT: localstack:4566
AWS_S3_BUCKET_NAME: backup
AWS_ACCESS_KEY_ID: _
AWS_SECRET_ACCESS_KEY: _
BACKUP_CRON_EXPRESSION: "* * * * *"
AWS_ENDPOINT_INSECURE: true
# The S3 container.
localstack:
container_name: web-git-s3
image: localstack/localstack:s3-latest
ports:
- "4566:4566"
environment:
DEBUG: 1
volumes:
- /var/run/docker.sock:/var/run/docker.sock
# Just to make sure that the bucket is generated is the S3 container.
bucket-script:
container_name: web-git-s3-script
image: amazon/aws-cli
depends_on:
- localstack
entrypoint: /bin/sh -c
environment:
AWS_ACCESS_KEY_ID: _
AWS_SECRET_ACCESS_KEY: _
AWS_ENDPOINT_URL: http://localstack:4566
command: |
"
aws s3api create-bucket --bucket backup
aws s3api create-bucket --bucket storage
"
volumes:
data: