Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Dockerfiles
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Picasoft
Technique
Dockerfiles
Commits
46384f35
Verified
Commit
46384f35
authored
4 years ago
by
Romain De Laage De Bellefaye
Browse files
Options
Downloads
Patches
Plain Diff
[CodiMD] Add supercronic to autoremove old pads each night
parent
bdf82b78
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
pica-codimd/Dockerfile
+11
-4
11 additions, 4 deletions
pica-codimd/Dockerfile
pica-codimd/crontab
+1
-0
1 addition, 0 deletions
pica-codimd/crontab
pica-codimd/entrypoint.sh
+3
-2
3 additions, 2 deletions
pica-codimd/entrypoint.sh
with
15 additions
and
6 deletions
pica-codimd/Dockerfile
+
11
−
4
View file @
46384f35
ARG
VERSION=2.2.0
ARG
PORTCHECKER_VERSION=v1.0.6
ARG
SCVERSION=v0.1.11
FROM
node:10.22.1-alpine3.11
as
BUILD
ARG
VERSION
ARG
SCVERSION
RUN
apk add
--no-cache
--virtual
.gyp libressl-dev git bash python make
&&
\
wget https://github.com/hackmdio/codimd/archive/
${
VERSION
}
.tar.gz
&&
\
tar
xzf
$VERSION
.tar.gz
-C
/opt
&&
\
mv
/opt/codimd-
$VERSION
/opt/codimd
wget https://github.com/hackmdio/codimd/archive/
${
VERSION
}
.tar.gz
&&
\
tar
xzf
$VERSION
.tar.gz
-C
/opt
&&
\
mv
/opt/codimd-
$VERSION
/opt/codimd
&&
\
wget https://github.com/aptible/supercronic/releases/download/
$SCVERSION
/supercronic-linux-amd64
&&
\
chmod
+x supercronic-linux-amd64
&&
\
mv
supercronic-linux-amd64 /opt/codimd/supercronic
RUN
cd
/opt/codimd
&&
npm
install
&&
\
npm run build
&&
\
...
...
@@ -26,7 +31,7 @@ RUN addgroup --gid 5010 codimd && \
mkdir
-p
/home/codimd/app/deletedPads
&&
\
chown
-R
codimd:codimd /home/codimd
&&
\
# Git needed so NPM can clone packages and Python for node-gyp
apk add --no-cache bash git python3-dev py3-pip gcc postgresql-dev musl-dev && \
apk add --no-cache bash git python3-dev py3-pip gcc postgresql-dev musl-dev
make
&& \
pip3 install psycopg2 && \
wget https://github.com/hackmdio/portchecker/releases/download/${PORTCHECKER_VERSION}/portchecker-linux-amd64.tar.gz && \
tar xvf portchecker-linux-amd64.tar.gz -C /usr/local/bin && \
...
...
@@ -41,6 +46,8 @@ COPY --chown=5010:5010 --from=BUILD /opt/codimd .
COPY
--chown=5010:5010 deleteOldPad.py .
COPY
crontab .
RUN
npm
install
--production
&&
npm cache clean
--force
&&
rm
-rf
/tmp/
{
core-js-banners,phantomjs
}
COPY
entrypoint.sh .
...
...
This diff is collapsed.
Click to expand it.
pica-codimd/crontab
0 → 100644
+
1
−
0
View file @
46384f35
0 0 * * * /home/codimd/app/deleteOldPad.py
This diff is collapsed.
Click to expand it.
pica-codimd/entrypoint.sh
+
3
−
2
View file @
46384f35
#! /bin/sh
sed
"154a | <a href=
\"
https://picasoft.net/co/cgu.html
\"
>CGU</a> "
-i
/home/codimd/app/public/views/index/body.ejs
/home/codimd/app/docker-entrypoint.sh
sed
"41a Cette instance ne garde le contenu que deux ans après la dernière modification !"
-i
/home/codimd/app/public/views/index/body.ejs
/home/codimd/app/docker-entrypoint.sh &
/home/codimd/app/supercronic /home/codimd/app/crontab
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment