Skip to content

Instantly share code, notes, and snippets.

@DutchCaveman
Created April 4, 2020 16:41
Show Gist options
  • Save DutchCaveman/4287549fc36dace5ac780ce023ddb05a to your computer and use it in GitHub Desktop.
Save DutchCaveman/4287549fc36dace5ac780ce023ddb05a to your computer and use it in GitHub Desktop.
Docker usage of BaGet with basic authentication
version: '3'
services:
authenticate:
image: "quay.io/dtan4/nginx-basic-auth-proxy:latest"
ports:
- 80:80
environment:
- BASIC_AUTH_USERNAME=username
- BASIC_AUTH_PASSWORD=password
- PROXY_PASS=http://nuget.julian.wtf/
- CLIENT_MAX_BODY_SIZE=100m
- SERVER_NAME=nuget.julian.wtf
networks:
- nuget.julian.wtf
restart: always
baget:
image: "loicsharma/baget"
container_name: nuget.julian.wtf
expose:
- 80
environment:
- ApiKey=
- PackageDeletionBehavior=HardDelete
networks:
- nuget.julian.wtf
restart: always
networks:
nuget.julian.wtf: ~
@DutchCaveman
Copy link
Author

DutchCaveman commented Jul 13, 2020

If Baget had some kind of security on it’s own it was not necessary to use nginx. So then you didn’t had to use this kind of construction. But really when using webserver software (nginx, Apache or even IIS) for basic authentication you have to use an reversed proxy of some kind. I just hacked this together on a sunday morning, when I was experimenting (with an raspberry pi) using docker 😉. Purpose of this was not to make the most neat setup, but create something disposable to setup within minutes. Because of docker’s container system and self configuring dependencies.

Maybe an better option for you could be the private package service Github is offering? An free account gets 500 MB of storage at this moment.

@chris1248
Copy link

Ok, I don't really know what a reverse proxy is.... so I think I am in over my head here. But thanks for the response.

@DutchCaveman
Copy link
Author

No problem! But maybe take a look at the mentioned private package service (NuGet, NPM, Maven) of Github 😉.

@chris1248
Copy link

I need this for nuget, and actually my preference for a package service was teamcity. But their implementation was broken: Hence why I was looking for alternatives.

@DutchCaveman
Copy link
Author

Then you should definitely contact JetBrains for support. It’s more neat to use a complete eco system of some kind, this becomes more important if it is used for more serious development purposes 😉.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment