Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
maotama-server
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
maotama-server
Commits
fc1f29bf
Commit
fc1f29bf
authored
Sep 29, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add cron for restarting maotama-server
parent
1127d9de
Pipeline
#831
passed with stages
in 6 minutes and 25 seconds
Changes
4
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
694 additions
and
8 deletions
+694
-8
Dockerfile
Dockerfile
+14
-7
LICENSE
LICENSE
+661
-0
README.md
README.md
+5
-1
pm2.json
pm2.json
+14
-0
No files found.
Dockerfile
View file @
fc1f29bf
...
...
@@ -10,18 +10,25 @@ WORKDIR /usr/src/app
COPY
./main.go ./
RUN
go build
-ldflags
"-s -w -extldflags '-static'"
-o
maotama-server main.go
FROM
debian
:buster-slim
FROM
node
:buster-slim
RUN
apt update
&&
\
apt
-y
install
dnsutils
&&
\
rm
-rf
/var/lib/apt/lists/
*
/tmp/
*
/var/tmp/
*
COPY
./entrypoint.sh /
env
DEBIAN_FRONTEND
=
noninteractive apt
-y
install
dnsutils cron tzdata
&&
\
rm
-rf
/var/lib/apt/lists/
*
/tmp/
*
/var/tmp/
*
&&
\
cp
-rf
/usr/share/zoneinfo/Asia/Shanghai /etc/localtime
&&
\
echo
"Asia/Shanghai"
>
/etc/timezone
&&
\
npm
-g
install
pm2
&&
\
ln
-s
/dev/stdout /var/log/cron.log
&&
\
echo
'*/5 * * * * /usr/local/bin/pm2 restart maotama-server'
>
/etc/cron.d/restart-maotama
&&
\
crontab /etc/cron.d/restart-maotama
COPY
./entrypoint.sh /data/
COPY
--from=builder /usr/src/app/maotama-server /usr/bin/
COPY
./pm2.json /data/
WORKDIR
/data
ENV
TZ Asia/Shanghai
ENTRYPOINT
[ "/entrypoint.sh" ]
CMD
[ "
/usr/bin/maotama-server
" ]
ENTRYPOINT
[ "/
data/
entrypoint.sh" ]
CMD
[ "
pm2-docker", "/data/pm2.json
" ]
LICENSE
0 → 100644
View file @
fc1f29bf
This diff is collapsed.
Click to expand it.
README.md
View file @
fc1f29bf
# maotama-server
Maotama server mirror
\ No newline at end of file
Maotama server.
# How to use
Use Docker image from
`git-registry.mycard.moe/mycard/maotama-server`
and mount the certs in
`/data/cert`
.
pm2.json
0 → 100644
View file @
fc1f29bf
{
"apps"
:
[
{
"name"
:
"restart-cron"
,
"script"
:
"/usr/sbin/cron"
,
"args"
:
"-f"
},
{
"name"
:
"maotama-server"
,
"script"
:
"/usr/bin/maotama-server"
,
"cwd"
:
"/data"
}
]
}
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