forked from pantheon-systems/documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
66 lines (48 loc) · 2.05 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
# Use a Pre-Built CircleCI Docker Image known to work with Composer
FROM circleci/php:7.1-node-browsers-legacy
# Define the user as circleci, as provided by the parent image
USER circleci
# Set working directory
WORKDIR documentation
# Install Ruby
RUN sudo apt-get install ruby-full
# Install Ruby dependencies
RUN sudo apt-get install zlib1g-dev
RUN sudo gem install pkg-config -v "~> 1.1"
RUN sudo chown -R circleci /var/lib/gems/ /usr/local/bin .
RUN gem install bundler --no-rdoc --no-ri
COPY --chown=circleci:circleci Gemfile ./
RUN bundle install --jobs=4
# Update Composer
#RUN composer self-update
# Install PHP dependencies
COPY --chown=circleci:circleci composer.json ./
COPY --chown=circleci:circleci composer.lock ./
RUN composer install
# Install node dependencies
COPY --chown=circleci:circleci package.json ./
RUN npm install
# Copy the working directories into the container
COPY --chown=circleci:circleci ./features /documentation/features
COPY --chown=circleci:circleci ./behat.yml ./budget.json ./Gruntfile.js ./Rakefile ./sculpin.json ./wraith.yaml /documentation/
# Copy the app directory
COPY --chown=circleci:circleci ./app /documentation/app
# Install Terminus Globally
RUN composer global require pantheon-systems/terminus
# Compile assets (CSS and Terminus Manual)
COPY --chown=circleci:circleci ./source /documentation/source
RUN node_modules/.bin/grunt
RUN ~/.composer/vendor/pantheon-systems/terminus/bin/terminus list > /documentation/source/docs/assets/terminus/commands.json --format=json
RUN curl https://api.github.com/repos/pantheon-systems/terminus/releases > /documentation/source/docs/assets/terminus/releases.json
# Generate the site in development mode (include drafts)
RUN bin/sculpin generate --env=dev
# Symlink source inside output_dev
RUN cd output_dev && ln -s ./ source
# Copy scripts into the container
COPY --chown=circleci:circleci ./scripts /documentation/scripts
# Run changelog fix script
RUN ./scripts/fix-changelog-index.sh
# Make port 8000 available to the world outside this container
EXPOSE 8000
# Add Versioning
ADD VERSION .