forked from mrsxl/ghost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
60 lines (47 loc) · 1.9 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM node:4.2-slim
RUN groupadd user && useradd --create-home --home-dir /home/user -g user user
RUN set -x \
&& apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# grab gosu for easy step-down from root
RUN gpg --keyserver pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4
RUN arch="$(dpkg --print-architecture)" \
&& set -x \
&& curl -o /usr/local/bin/gosu -fSL "https://github.com/tianon/gosu/releases/download/1.7/gosu-$arch" \
&& curl -o /usr/local/bin/gosu.asc -fSL "https://github.com/tianon/gosu/releases/download/1.7/gosu-$arch.asc" \
&& gpg --verify /usr/local/bin/gosu.asc \
&& rm /usr/local/bin/gosu.asc \
&& chmod +x /usr/local/bin/gosu
ENV GHOST_SOURCE /usr/src/ghost
ENV ORIGIN_SOURCE https://github.com/CareyToboo/myghost/archive/master.zip
WORKDIR $GHOST_SOURCE
#ENV GHOST_VERSION 0.7.2
RUN buildDeps=' \
gcc \
make \
python \
unzip \
' \
&& set -x \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
#&& curl -sSL "https://ghost.org/archives/ghost-${GHOST_VERSION}.zip" -o ghost.zip \
&& curl -sSL "https://github.com/CareyToboo/myghost/archive/master.zip" -o ghost.zip \
&& unzip ghost.zip \
&& mv ./myghost-master/* ./ \
&& rm -rf ./myghost-master \
#&& npm install --production \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false $buildDeps \
&& rm -rf ghost.zip
#&& npm cache clean \
#&& rm -rf /tmp/npm*
ENV GHOST_CONTENT /var/ghost
RUN mkdir -p "$GHOST_CONTENT" && chown -R user:user "$GHOST_CONTENT"
VOLUME $GHOST_CONTENT
COPY docker-entrypoint.sh /entrypoint.sh
COPY start.sh /start.sh
RUN rm -rf /usr/src/ghost/config.js /usr/src/ghost/config.example.js
COPY config.example.js /usr/src/ghost/
RUN chmod a+x /start.sh
EXPOSE 2368
CMD ["/start.sh"]