• Stars
    star
    147
  • Rank 251,347 (Top 5 %)
  • Language
    Dockerfile
  • License
    MIT License
  • Created over 8 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

πŸ” Simple Docker image for basic authentication

GitHub Workflow Status Docker Pulls Docker Stars Docker Image Size (tag) License GitHub release GitHub Release Date CalVer Beevelop

nginx-basic-auth


Simple Docker image to provide basic authentication for a single other container.

Quickstart

docker run -d --name web dockercloud/hello-world
docker run -d -p 80:80 --link web:web --name auth beevelop/nginx-basic-auth

Try accessing and logging in with username foo and password bar.

Advanced

docker run -d \
           -e HTPASSWD='foo:$apr1$odHl5EJN$KbxMfo86Qdve2FH4owePn.' \
           -e FORWARD_PORT=1337 \
           --link web:web -p 8080:80 \
           --name auth \
           beevelop/nginx-basic-auth

Use single quotes to prevent unwanted interpretation of $ signs!

Configuration

  • HTPASSWD (default: foo:$apr1$odHl5EJN$KbxMfo86Qdve2FH4owePn.): Will be written to the .htpasswd file on launch (non-persistent)
  • FORWARD_PORT (default: 80): Port of the source container that should be forwarded
  • FORWARD_HOST (default: web): Hostname of the source container that should be forwarded

    The container does not need any volumes to be mounted! Nonetheless you will find all interesting files at /etc/nginx/*.

Multiple Users

Multiple Users are possible by separating the users by newline. To pass the newlines properly you need to use Shell Quoting (like $'foo\nbar'):

docker run -d --link web:web --name auth \
           -e HTPASSWD=$'foo:$apr1$odHl5EJN$KbxMfo86Qdve2FH4owePn.\ntest:$apr1$LKkW8P4Y$P1X/r2YyaexhVL1LzZAQm.' \
           beevelop/nginx-basic-auth

results in 2 users (foo:bar and test:test).

Troubleshooting

nginx: [emerg] host not found in upstream "web" in /etc/nginx/conf.d/auth.conf:80
  • You need to link the container as web (--link foobar:web)

  • SSL is unsupported ATM, but might be available in the near future. For now it might be a suitable solution to use another reverse proxy (e.g. jwilder/nginx-proxy) that acts as a central gateway. You just need to configure the VIRTUAL_HOST env and disable port forwarding.

More Repositories

1

docker-ionic

🎒 Docker image for Ionic (with Android & Cordova)
Dockerfile
95
star
2

docker-cordova

πŸ—Ώ Docker image for Cordova 12 (with Node.js & Android)
Dockerfile
74
star
3

docker-android

πŸ“± Personal Android Docker image
Dockerfile
55
star
4

ng-stomp

πŸ“‘ STOMP for AngularJS
JavaScript
43
star
5

docker-android-nodejs

πŸ“± Android 11 with Node.js Docker image
Dockerfile
26
star
6

apk-signer

πŸ” simple command line tool for easily (re)sign apks
JavaScript
19
star
7

ng-feathers

🐦 FeathersJS client for plain old AngularJS
JavaScript
18
star
8

docker-shields

Shields.io in a Docker image 🐳
18
star
9

docker-directus

πŸ‡ Directus is an awesome database GUI that provides a feature-rich environment for rapid development and management of custom database schemas.
Shell
14
star
10

docker-nodejs-python

🐍 Python 3 with Node.js 14 based on Ubuntu 20.04
Dockerfile
11
star
11

TSHITS

πŸ‘•πŸ’©The Self-Hosted, Independent Technology Stack (T-SHITS) using Docker Compose
Shell
9
star
12

docker-node-red

🐳 A tool for wiring together hardware devices, APIs and online services in new and interesting ways.
Dockerfile
9
star
13

docker-kin

Kin is the calendar experience we want after Sunrise and integrates all the services we use everyday.
6
star
14

docker-uniqush

πŸ“² Uniqush provides a unified push service for server-side notification to apps on any supported mobile platform.
Dockerfile
6
star
15

docker-java

β˜• Java (Java / OpenJDK 17.0) based on Ubuntu 22.04
Dockerfile
6
star
16

docker-kin-server

Kin is the calendar experience we want after Sunrise and integrates all the services we use everyday.
JavaScript
5
star
17

rasa-client

Simple Node.js wrapper around the Rasa core HTTP server
JavaScript
4
star
18

docker-youtransfer

πŸ’Ύ A simple but elegant self-hosted file transfer & sharing solution
4
star
19

docker-weinre

🍷 weinre (WEb INspector REmote) is a remote debugger for web pages – perfect for mobile devices
4
star
20

docker-cuberite

πŸ•Ή Cuberite for Docker
Dockerfile
3
star
21

docker-scancode

Docker image for the Scancode-Toolkit
Dockerfile
3
star
22

docker-nodejs

πŸ‘¨β€πŸ’» Node.js 14 based on Ubuntu 20.04
Dockerfile
3
star
23

docker-weblate

Weblate is a translation tool with tight version control integration and a simple & clean UI.
Python
3
star
24

docker-base

🏑 Base image (Ubuntu 22.04)
Dockerfile
3
star
25

docker-kin-client

Kin is the calendar experience we want after Sunrise and integrates all the services we use everyday.
JavaScript
3
star
26

docker-wordpress

πŸ‹ WordPress for Docker on Steroids
Shell
2
star
27

fontawesome-spritesheet

Generates PNG Sprite Sheets for Font Awesome (https://fontawesome.io/)
JavaScript
2
star
28

docker-taiga-back

Python
2
star
29

docker-rabbitmq-stomp

RabbitMQ with support for STOMP and SockJS
2
star
30

docker-watchmen

Solid Docker image for WatchMen
2
star
31

docker-taiga-front

Taiga is a simple, beautiful project management tool for startups and agile developers & designers.
Nginx
2
star
32

docker-vaultier

🐳 Vaultier is an enterprise-grade collaborative password manager and encrypted file storage.
Python
1
star
33

docker-nexus

Sonatype Nexus 3 for Docker based on Alpine (unofficial)
1
star
34

football-api

JavaScript
1
star
35

docker-wade

🐳 Personal Web Application Development Environment (primarily thought to be used as an CI runner)
1
star
36

docker-fastlane-supply

Command line tool for updating Android apps and their metadata on the Google Play Store
1
star
37

stomp-ui

UI for playing around with STOMP
HTML
1
star