This repository has been archived by the owner on May 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (47 loc) · 1.67 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
FROM node:0.10-slim
MAINTAINER Karam EL HABOUTI <[email protected]>
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 curl -o /usr/local/bin/gosu -sSL "https://github.com/tianon/gosu/releases/download/1.6/gosu-$(dpkg --print-architecture)" \
&& chmod +x /usr/local/bin/gosu
ENV GHOST_SOURCE /usr/src/ghost
WORKDIR $GHOST_SOURCE
ENV GHOST_VERSION 0.7.1
# NODE_PORT ==> Port where pm2 will bind
ENV NODE_PORT 2368
# Mailgun configs
ENV MAILGUN_USER [email protected]
ENV MAILGUN_PASSWORD secret
# Mail from configs
ENV MAIL_FROM_NAME "Your Name"
ENV MAIL_FROM_ADDRESS [email protected]
# Ghost url
ENV GHOST_URL http://blog.example.com
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 \
&& unzip ghost.zip \
&& npm install --production \
&& npm install pm2 -g \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false $buildDeps \
&& rm ghost.zip \
&& npm cache clean \
&& rm -rf /tmp/npm*
ADD config.example.js config.example.js
ENV GHOST_CONTENT /var/lib/ghost
RUN mkdir -p "$GHOST_CONTENT" && chown -R user:user "$GHOST_CONTENT"
VOLUME $GHOST_CONTENT
COPY docker-entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE $NODE_PORT
CMD ["pm2", "start","index.js","--no-daemon"]