Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add command options and documentation to Docker Compose #1645

Merged
merged 9 commits into from
Jan 12, 2024
Next Next commit
Add command options and documentation to Docker Compose
This commit introduces the command configuration for the bandersnatch service in Docker Compose setup.
It includes the default 'mirror' command and adds commented options for 'verify' and 'once' to provide alternatives for running bandersnatch.

The 'command' section is now clearly documented, making it easier for developers and sysadmins to understand and modify the behavior of the bandersnatch service.

Changes:
- Added 'command' directive to bandersnatch service with the default 'mirror' option.
- Included comments explaining how to use the 'verify' and 'once' commands.
- Explained the purpose of additional flags for the 'mirror' command.
- Provided documentation for the build context of the bandersnatch_nginx image.
  • Loading branch information
benjisho authored Jan 10, 2024
commit e4834617168bb144b7d98d28a1a02aafd392875d
25 changes: 19 additions & 6 deletions src/bandersnatch_docker_compose/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
services:
# The bandersnatch service configuration
bandersnatch:
image: pypa/bandersnatch:latest
image: pypa/bandersnatch:latest # Use the latest version of bandersnatch
volumes:
- "./config:/conf"
- "./data:/srv/pypi/web"
- "./config:/conf" # Mount the local configuration directory to the container
- "./data:/srv/pypi/web" # Mount the local data directory where the mirror will be stored
command: bandersnatch mirror
# Uncomment the command you want to use:
# command: bandersnatch verify # Verifies the integrity of the mirror
# command: bandersnatch once # Runs the mirror operation once and then exits

# Default command is 'mirror', which synchronizes the mirror with PyPI
# You can append additional flags to customize the 'mirror' behavior:
# "--force-check" to force a recheck of all packages
# "--delete-packages" to remove packages that have been deleted from PyPI
networks:
- bandersnatch_net
- bandersnatch_net # Connects the service to the custom bridge network

# The nginx service configuration for serving the mirror
bandersnatch_nginx:
image: bandersnatch_nginx
# If the image not built yet, it will be built from the nginx image from the Dockerfile in the current directory
build: .
volumes:
- "./data:/data/pypi/web:ro"
- "./data:/data/pypi/web:ro" # Mount the data directory as read-only for nginx
ports:
- "40080:80"
- "40080:80" # Map port 40080 on the host to port 80 in the container
networks:
- bandersnatch_net

Expand Down
Loading