Skip to content

Instantly share code, notes, and snippets.

@cloverstd
Created August 28, 2016 11:55
Show Gist options
  • Save cloverstd/e1b19d67b4d91f9704feafdd38b68824 to your computer and use it in GitHub Desktop.
Save cloverstd/e1b19d67b4d91f9704feafdd38b68824 to your computer and use it in GitHub Desktop.
ghost 0.9 Dockerfile
# http://support.ghost.org/supported-node-versions/
FROM node:4-slim
RUN groupadd user && useradd --create-home --home-dir /home/user -g user user
RUN apt-get update && apt-get install -y \
ca-certificates \
wget \
--no-install-recommends && rm -rf /var/lib/apt/lists/*
# grab gosu for easy step-down from root
ENV GOSU_VERSION 1.7
RUN set -x \
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \
&& wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \
&& export GNUPGHOME="$(mktemp -d)" \
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
&& gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
&& rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \
&& chmod +x /usr/local/bin/gosu \
&& gosu nobody true
ENV GHOST_SOURCE /usr/src/ghost
WORKDIR $GHOST_SOURCE
ENV GHOST_VERSION 0.9.0
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/* \
&& wget -O ghost.zip "https://ghost.org/archives/ghost-${GHOST_VERSION}.zip" \
&& unzip ghost.zip \
&& npm install --production \
&& 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*
VOLUME $GHOST_SOURCE/content
EXPOSE 2368
CMD ["npm", "start"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment