/
Dockerfile
executable file
·70 lines (54 loc) · 2.07 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
61
62
63
64
65
66
67
68
69
70
FROM centos:7
MAINTAINER Karl Stoney <me@karlstoney.com>
# Get dependencies
RUN yum -y -q install which curl wget gettext patch gcc-c++ make git-core bzip2 unzip gcc python-devel python-setuptools redhat-rpm-config && \
yum -y -q clean all
# Install crcmod
RUN easy_install -U pip && \
pip install -U crcmod
# Get nodejs repos
RUN curl --silent --location https://rpm.nodesource.com/setup_8.x | bash -
# Install nodejs, max currently supported is 6.9.0
RUN yum -y -q install nodejs-8.* && \
yum -y -q clean all
# Setup www-data user
RUN groupadd www-data && \
useradd -r -g www-data www-data
RUN mkdir -p /var/www && \
mkdir -p /home/www-data && \
chown -R www-data:www-data /var/www && \
chown -R www-data:www-data /home/www-data
EXPOSE 2368
# Configuration
ENV GHOST_HOME /var/www/ghost
# Install Gcloud utilities
ENV CLOUDSDK_INSTALL_DIR /usr/lib64/google-cloud-sdk
ENV CLOUDSDK_PYTHON_SITEPACKAGES 1
COPY gcloud.repo /etc/yum.repos.d/
RUN mkdir -p /etc/gcloud/keys
ARG GCLOUD_VERSION
# Install packages
RUN yum -y -q update && \
yum -y -q install google-cloud-sdk-$GCLOUD_VERSION && \
yum -y -q clean all
# Disable google cloud auto update... we should be pushing a new agent container
RUN gcloud config set --installation component_manager/disable_update_check true && \
gcloud config set component_manager/disable_update_check true && \
gcloud config set core/disable_usage_reporting true
CMD ["/usr/local/bin/start_ghost.sh"]
# Install Ghost
WORKDIR $GHOST_HOME
RUN npm install -g ghost-cli@latest
RUN chown -R www-data:www-data $GHOST_HOME
ARG GHOST_VERSION
RUN su -c 'ghost install local --no-setup --db sqlite3 --v$GHOST_VERSION' www-data
# Add static content generator
ARG SITEMAP_GENERATOR_VERSION
RUN npm install -g ghost-static-site-generator@$SITEMAP_GENERATOR_VERSION
RUN mkdir /static
# Patch ghost
RUN mkdir -p /usr/local/etc/ghost/patches
COPY patches/ /usr/local/etc/ghost/patches/
COPY bin/* /usr/local/bin/
RUN /usr/local/bin/apply_patches.sh
COPY data/config.json /var/www/ghost/current/core/server/config/env/config.production.json