mirror of
https://github.com/luzifer-docker/codimd.git
synced 2024-09-19 16:22:56 +00:00
Port to alpine, pin version
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
1970ee48e2
commit
56867e6eed
43
Dockerfile
43
Dockerfile
@ -1,6 +1,33 @@
|
|||||||
FROM node:7
|
FROM node:7-alpine as builder
|
||||||
|
|
||||||
ENV VERSION master
|
ARG CODIMD_VERSION=1.2.1
|
||||||
|
ARG BUILD_ASSETS=false
|
||||||
|
|
||||||
|
RUN set -ex \
|
||||||
|
&& apk add --no-cache \
|
||||||
|
bash \
|
||||||
|
build-base \
|
||||||
|
curl \
|
||||||
|
git \
|
||||||
|
make \
|
||||||
|
python \
|
||||||
|
tar \
|
||||||
|
&& mkdir /hackmd \
|
||||||
|
&& curl -sSfL https://github.com/hackmdio/codimd/archive/${CODIMD_VERSION}.tar.gz | tar -xzf - --strip-components=1 -C /hackmd \
|
||||||
|
&& cd /hackmd \
|
||||||
|
&& npm install --loglevel warn \
|
||||||
|
grunt \
|
||||||
|
webpack \
|
||||||
|
webpack-cli \
|
||||||
|
&& npm install --loglevel warn \
|
||||||
|
&& npm run build \
|
||||||
|
&& rm -rf node_modules \
|
||||||
|
&& NODE_ENV=production npm install --loglevel warn
|
||||||
|
|
||||||
|
|
||||||
|
FROM node:7-alpine
|
||||||
|
|
||||||
|
LABEL codimd_version=1.2.1
|
||||||
|
|
||||||
# ENV DEBUG true
|
# ENV DEBUG true
|
||||||
# ENV HMD_DOMAIN localhost
|
# ENV HMD_DOMAIN localhost
|
||||||
@ -47,17 +74,11 @@ ENV VERSION master
|
|||||||
# ENV HMD_S3_BUCKET ""
|
# ENV HMD_S3_BUCKET ""
|
||||||
|
|
||||||
RUN set -ex \
|
RUN set -ex \
|
||||||
&& mkdir /hackmd \
|
&& apk add --no-cache bash
|
||||||
&& curl -sSfL https://github.com/hackmdio/hackmd/archive/${VERSION}.tar.gz | tar -xzf - --strip-components=1 -C /hackmd
|
|
||||||
|
|
||||||
WORKDIR /hackmd
|
COPY --from=builder /hackmd /hackmd
|
||||||
|
|
||||||
RUN set -ex \
|
ADD run.sh /usr/local/bin/run.sh
|
||||||
&& npm install webpack \
|
|
||||||
&& npm install \
|
|
||||||
&& npm run build
|
|
||||||
|
|
||||||
ADD run.sh /usr/local/bin/run.sh
|
|
||||||
ADD config.json /hackmd/config.json.default
|
ADD config.json /hackmd/config.json.default
|
||||||
ADD sequelizerc /hackmd/.sequelizerc.default
|
ADD sequelizerc /hackmd/.sequelizerc.default
|
||||||
|
|
||||||
|
14
run.sh
14
run.sh
@ -1,22 +1,22 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -euxo pipefail
|
||||||
|
|
||||||
set -o pipefail
|
cd /hackmd
|
||||||
set -ex
|
|
||||||
|
|
||||||
if ! [ -f /config/config.json ]; then
|
if ! [ -f /config/config.json ]; then
|
||||||
cp config.json.default config.json
|
cp config.json.default config.json
|
||||||
else
|
else
|
||||||
cp /config/config.json config.json
|
cp /config/config.json config.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! [ -f /config/.sequelizerc ]; then
|
if ! [ -f /config/.sequelizerc ]; then
|
||||||
cp .sequelizerc.default .sequelizerc
|
cp .sequelizerc.default .sequelizerc
|
||||||
else
|
else
|
||||||
cp /config/.sequelizerc .sequelizerc
|
cp /config/.sequelizerc .sequelizerc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f /config/client_config.js ]; then
|
if [ -f /config/client_config.js ]; then
|
||||||
cp /config/client_config.js public/js/config.js
|
cp /config/client_config.js public/js/config.js
|
||||||
fi
|
fi
|
||||||
|
|
||||||
node_modules/.bin/sequelize db:migrate
|
node_modules/.bin/sequelize db:migrate
|
||||||
|
Loading…
Reference in New Issue
Block a user