Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
cdn-docker
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
cdn-docker
Commits
1df1b11d
Commit
1df1b11d
authored
Dec 03, 2019
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first
parent
dd47c10d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
1 deletion
+76
-1
Dockerfile
Dockerfile
+35
-0
README.md
README.md
+15
-1
logrotate.conf
logrotate.conf
+7
-0
pm2.json
pm2.json
+19
-0
No files found.
Dockerfile
0 → 100644
View file @
1df1b11d
FROM
node:buster-slim
# pm2
RUN
npm
install
-g
pm2
# apt
RUN
apt update
&&
\
env
DEBIAN_FRONTEND
=
noninteractive apt
-y
install
wget gnupg ca-certificates software-properties-common
&&
\
wget
-O
- https://openresty.org/package/pubkey.gpg | apt-key add -
&&
\
add-apt-repository
-y
"deb http://openresty.org/package/debian
$(
lsb_release
-sc
)
openresty"
&&
\
apt update
&&
\
env
DEBIAN_FRONTEND
=
noninteractive apt
-y
install
openresty rsync logrotate openssh-server python locales cron
&&
\
rm
-rf
/var/lib/apt/lists/
*
# configures
RUN
ln
-s
/usr/bin/openresty /usr/bin/nginx
&&
\
ln
-s
/etc/openresty /etc/nginx
&&
\
mkdir
/var/log/nginx
&&
\
echo
'0 4 * * * /usr/sbin/logrotate /etc/logrotate.conf'
>
/etc/cron.d/logrotate
&&
\
crontab /etc/cron.d/logrotate
&&
\
mkdir
-p
/var/run/sshd
&&
\
mkdir
/root/.ssh
&&
\
echo
'PermitRootLogin yes'
>>
/etc/ssh/sshd_config
&&
\
echo
'ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAtRix6NrCSXMNpL9WuD6DA198aGirvb8cYIcx5fS98/EWqA8n8yjBEjfLkWZviSh8J6hDw5x4rlZWa777eP+qFfwZO5MjQp/n3cgpZgnbJFRUROuNEyaGQvv09uO05cgRKemVDysqte6xjH6YOts/+oX6dC/JK+Cwi7K0kUETQ2WLLTghyQfLkwKoXkP30v/j18yfyswyWsM1E70stmezMRYswsAeOP6j5/dZiSY9vPCPHJ0w3cGhV+YZcWVE3687cQyf++Iv4AGBzRWlGStGHfb3UB8fkeIClChkQDjjzrxfbrmeS3kC5w6hkbZFsreM8ZvWhDvB1eBxjU9KKbV0iQ== zh99998@gmail.com'
>>
/root/.ssh/authorized_keys
&&
\
echo
"zh_CN.UTF-8 UTF-8"
>
/etc/locale.gen
&&
\
ln
-sf
/usr/share/zoneinfo/Asia/Shanghai /etc/localtime
&&
\
locale-gen
&&
\
dpkg-reconfigure
-f
noninteractive locales tzdata
&&
\
/usr/sbin/update-locale
LANG
=
zh_CN.UTF-8
ENV
LANG=zh_CN.UTF-8
COPY
logrotate.conf /etc/logrotate.conf
COPY
./pm2.json /etc/pm2.json
EXPOSE
22 80 443
CMD
["pm2-docker", "/etc/pm2.json"]
README.md
View file @
1df1b11d
# cdn-docker
mycard cdn node in docker
MyCard CDN node with SSH in docker
## Docker Info
### Ports
*
`22`
: SSH Port
*
`80`
: HTTP Port
*
`443`
: HTTPS Port
### Volumes
*
`/etc/nginx`
*
`/var/log/nginx`
*
`/root/.ssh/authorized_keys`
if necessary
logrotate.conf
0 → 100644
View file @
1df1b11d
/
var
/
log
/
nginx
/
access
.
log
{
daily
rotate
3
postrotate
curl
https
://
poi
.
mycard
.
moe
:
444
/ --
data
-
binary
@$
1
endscript
}
pm2.json
0 → 100644
View file @
1df1b11d
{
"apps"
:
[
{
"name"
:
"sshd"
,
"script"
:
"/usr/sbin/sshd"
,
"args"
:
"-D"
},
{
"name"
:
"cron"
,
"script"
:
"/usr/sbin/cron"
,
"args"
:
"-f"
},
{
"name"
:
"nginx"
,
"script"
:
"/usr/bin/nginx"
,
"args"
:
"-g
\"
daemon off;
\"
"
}
]
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment