File tree Expand file tree Collapse file tree 7 files changed +72
-0
lines changed Expand file tree Collapse file tree 7 files changed +72
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # docker-compose -f docker-compose.yml up -d
3
+ docker-compose build
4
+ docker stack deploy -c docker-compose.yml registry
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # docker stack rm registry
3
+ docker-compose -f docker-compose.yml down
Original file line number Diff line number Diff line change
1
+ version : " 3.7"
2
+ services :
3
+ auth :
4
+ build : ./nginx
5
+ image : aussume_nginx_auth
6
+ ports :
7
+ - 5001:80
8
+ links :
9
+ - registry
10
+ environment :
11
+ USER : " <YourUserName>"
12
+ PASS : " <YourPassword>"
13
+ # depends_on:
14
+ # - registry
15
+
16
+ registry :
17
+ image : registry:latest
18
+
Original file line number Diff line number Diff line change
1
+ FROM nginx
2
+
3
+ RUN apt-get update -y \
4
+ && apt-get install -y \
5
+ apache2-utils \
6
+ && rm -rf /var/lib/apt/lists/*
7
+
8
+ ENV FORWARD_PORT=80
9
+
10
+ WORKDIR /opt
11
+
12
+ # RUN apk add --no-cache gettext
13
+
14
+ COPY auth.conf auth.htpasswd launch.sh ./
15
+
16
+ RUN chmod 0755 ./launch.sh
17
+
18
+ CMD ["./launch.sh" ]
Original file line number Diff line number Diff line change
1
+ server {
2
+ listen *:80 default_server;
3
+ return 444;
4
+ }
5
+
6
+ server {
7
+ listen *:80;
8
+ server_name 127.0.0.1;
9
+
10
+ location / {
11
+ satisfy any;
12
+ allow all;
13
+
14
+ proxy_pass http://registry:5000;
15
+ proxy_read_timeout 900;
16
+ }
17
+ }
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+
4
+ envsubst < auth.conf > /etc/nginx/conf.d/auth.conf
5
+ envsubst < auth.htpasswd > /etc/nginx/auth.htpasswd
6
+
7
+ htpasswd -c -b /etc/nginx/auth.htpasswd $USER $PASS
8
+
9
+ echo basic-auth-pwd
10
+ cat /etc/nginx/auth.htpasswd
11
+
12
+ nginx -g " daemon off;"
You can’t perform that action at this time.
0 commit comments