70 lines
2.3 KiB
YAML
70 lines
2.3 KiB
YAML
services:
|
|
azurite:
|
|
container_name: azurite-portfolio
|
|
image: mcr.microsoft.com/azure-storage/azurite
|
|
ports:
|
|
- '10000:10000'
|
|
- '10001:10001'
|
|
- '10002:10002'
|
|
command: 'azurite --blobHost 0.0.0.0 --queueHost 0.0.0.0 --tableHost 0.0.0.0 --loose --skipApiVersionCheck'
|
|
healthcheck:
|
|
test: ["CMD", "nc", "-z", "127.0.0.1", "10000"]
|
|
volumes:
|
|
- ./azurite-data:/data
|
|
|
|
# seed:
|
|
# image: mcr.microsoft.com/azure-cli
|
|
# depends_on:
|
|
# azurite:
|
|
# condition: service_healthy
|
|
# volumes:
|
|
# - ./seed-data:/data
|
|
# entrypoint: >
|
|
# sh -c "
|
|
# az storage container create --name mycontainer --connection-string 'DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;' &&
|
|
# az storage blob upload-batch --destination mycontainer --source /data --connection-string 'DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;'
|
|
# "
|
|
|
|
restore:
|
|
container_name: restore
|
|
image: litestream/litestream:0.5.2
|
|
volumes:
|
|
- ./database/portfolio.db:/mnt/data/portfolio.db
|
|
- ./database/litestream/litestream.yml:/mnt/litestream/litestream.yml
|
|
- backup:/mnt/data/backup
|
|
- data:/mnt/data
|
|
command: restore -config /mnt/litestream/litestream.yml -if-db-not-exists -if-replica-exists /mnt/data/portfolio.db
|
|
|
|
app:
|
|
container_name: portfolio
|
|
build:
|
|
context: .
|
|
ports:
|
|
- '3000:3000'
|
|
env_file:
|
|
- ./api/.env
|
|
environment:
|
|
- DB_PATH=../../mnt/data/portfolio.db
|
|
volumes:
|
|
- data:/mnt/data
|
|
depends_on:
|
|
restore:
|
|
condition: service_completed_successfully
|
|
|
|
replicate:
|
|
container_name: replicate
|
|
image: litestream/litestream:0.5.2
|
|
volumes:
|
|
- ./database/litestream/litestream.yml:/mnt/litestream/litestream.yml
|
|
- backup:/mnt
|
|
- data:/mnt/data
|
|
command: replicate -config /mnt/litestream/litestream.yml
|
|
depends_on:
|
|
app:
|
|
condition: service_started
|
|
|
|
volumes:
|
|
azurite-data:
|
|
backup:
|
|
data:
|
|
# seed-data: |