• Stars
    star
    143
  • Rank 251,343 (Top 6 %)
  • Language
    Dockerfile
  • License
    MIT License
  • Created almost 8 years ago
  • Updated 8 months 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
94
star
2

docker-cordova

๐Ÿ—ฟ Docker image for Cordova 12 (with Node.js & Android)
Dockerfile
73
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

ng-feathers

๐Ÿฆ FeathersJS client for plain old AngularJS
JavaScript
18
star
7

apk-signer

๐Ÿ” simple command line tool for easily (re)sign apks
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

fontawesome-spritesheet

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

docker-wordpress

๐Ÿ‹ WordPress for Docker on Steroids
Shell
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