fixed
This commit is contained in:
13
backend/deployment/Dockerfile.minio
Executable file
13
backend/deployment/Dockerfile.minio
Executable file
@@ -0,0 +1,13 @@
|
||||
FROM quay.io/minio/minio
|
||||
|
||||
RUN mkdir /storage
|
||||
|
||||
VOLUME /storage
|
||||
|
||||
ENV MINIO_ROOT_USER=MINIO_ROOT_USER
|
||||
ENV MINIO_ROOT_PASSWORD=MINIO_ROOT_PASSWORD
|
||||
ENV MINIO_VOLUMES="/storage"
|
||||
EXPOSE 9000
|
||||
EXPOSE 9093
|
||||
|
||||
CMD ["minio", "server", "/storage", "--console-address", ":9093"]
|
||||
11
backend/deployment/docker-compose.prod.yaml
Normal file
11
backend/deployment/docker-compose.prod.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
# Production override: points main-server at the pre-built image from the
|
||||
# self-hosted registry and adds the Watchtower label so it gets auto-updated.
|
||||
#
|
||||
# Deploy on the VPS with:
|
||||
# docker compose -f docker-compose.yaml -f deployment/docker-compose.prod.yaml pull main-server
|
||||
# docker compose -f docker-compose.yaml -f deployment/docker-compose.prod.yaml up -d
|
||||
services:
|
||||
main-server:
|
||||
image: localhost:5000/bankline:latest
|
||||
labels:
|
||||
- "com.centurylinklabs.watchtower.enable=true"
|
||||
3
backend/deployment/registry/.env.example
Normal file
3
backend/deployment/registry/.env.example
Normal file
@@ -0,0 +1,3 @@
|
||||
# Copy to .env and fill in.
|
||||
# Generate a token with: openssl rand -hex 32
|
||||
WATCHTOWER_TOKEN=
|
||||
18
backend/deployment/registry/create-user.sh
Executable file
18
backend/deployment/registry/create-user.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
# Usage: ./create-user.sh <username> <password>
|
||||
# Appends (or creates) the htpasswd file the registry uses for auth.
|
||||
set -e
|
||||
|
||||
if [ $# -ne 2 ]; then
|
||||
echo "Usage: $0 <username> <password>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
||||
AUTH_DIR="$SCRIPT_DIR/auth"
|
||||
mkdir -p "$AUTH_DIR"
|
||||
|
||||
docker run --rm --entrypoint htpasswd httpd:2.4-alpine -Bbn "$1" "$2" \
|
||||
>> "$AUTH_DIR/htpasswd"
|
||||
|
||||
echo "Added/updated user '$1' in $AUTH_DIR/htpasswd"
|
||||
38
backend/deployment/registry/docker-compose.yaml
Normal file
38
backend/deployment/registry/docker-compose.yaml
Normal file
@@ -0,0 +1,38 @@
|
||||
services:
|
||||
registry:
|
||||
image: registry:2
|
||||
container_name: docker-registry
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- REGISTRY_AUTH=htpasswd
|
||||
- REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm
|
||||
- REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd
|
||||
- REGISTRY_STORAGE_DELETE_ENABLED=true
|
||||
ports:
|
||||
# Only reachable from the VPS itself. Docker treats 127.0.0.0/8 as
|
||||
# trusted, so pushes/pulls work here without TLS. Reach it from
|
||||
# elsewhere via an SSH tunnel (see scripts/deploy.sh).
|
||||
- "127.0.0.1:5000:5000"
|
||||
volumes:
|
||||
- registry-data:/var/lib/registry
|
||||
- ./auth:/auth:ro
|
||||
|
||||
watchtower:
|
||||
image: containrrr/watchtower
|
||||
container_name: watchtower
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- WATCHTOWER_LABEL_ENABLE=true
|
||||
- WATCHTOWER_HTTP_API_UPDATE=true
|
||||
- WATCHTOWER_HTTP_API_TOKEN=${WATCHTOWER_TOKEN}
|
||||
- WATCHTOWER_CLEANUP=true
|
||||
ports:
|
||||
- "127.0.0.1:8080:8080"
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
# Reuses the VPS's own `docker login localhost:5000` credentials
|
||||
# so Watchtower can pull the private image.
|
||||
- ~/.docker/config.json:/config.json:ro
|
||||
|
||||
volumes:
|
||||
registry-data:
|
||||
Reference in New Issue
Block a user