Skip to content

Commit 4599a5e

Browse files
committed
Add custom username for apache basic auth
1 parent c053a42 commit 4599a5e

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

docker-compose.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ services:
77
volumes:
88
- ./settings:/app/settings
99
environment:
10+
- AUTH_USER=username
1011
- AUTH_PASSWORD=yourpasswordhere
1112

1213
mongo:

docker/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
# Generate the .htpasswd file
4-
htpasswd -cb /etc/apache2/.htpasswd user "$AUTH_PASSWORD"
4+
htpasswd -cb /etc/apache2/.htpasswd "$AUTH_USER" "$AUTH_PASSWORD"
55

66
# Start Apache in the foreground
77
exec apachectl -D FOREGROUND

0 commit comments

Comments
 (0)