Skip to content

Commit

Permalink
add docker env
Browse files Browse the repository at this point in the history
  • Loading branch information
hofbi committed Aug 10, 2020
1 parent 5ee2d53 commit dae547f
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: ruby
rvm:
- 2.6.3
- 2.7.0

addons:
apt:
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ All Downloads and Sources: [makeappdev.github.io/TUM-Projekte/](https://makeappd

## Setup & Build

```
```shell
# Install
make install

Expand All @@ -19,3 +19,9 @@ make test
# Build and run locally
make run
```

or use our [Dockerfile](docker/) container

```shell
docker-compose up # Now you can access the website at localhost:4000/TUM-Projekte/
```
24 changes: 24 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM ruby:2.7

ENV JEKYLL_VAR_DIR=/var/jekyll
ENV JEKYLL_DATA_DIR=/srv/jekyll
ENV JEKYLL_ENV=development

RUN apt-get update

RUN echo "gem: --no-ri --no-rdoc" >~/.gemrc
RUN unset GEM_HOME && unset GEM_BIN && yes | gem update --system

RUN unset GEM_HOME && unset GEM_BIN && yes | gem install --force bundler
RUN gem install jekyll rspec html-proofer pygments.rb jekyll-pandoc

RUN mkdir -p $JEKYLL_VAR_DIR $JEKYLL_DATA_DIR && rm -rf /root/.gem /home/jekyll/.gem $BUNDLE_HOME/cache $GEM_HOME/cache

ENV LANG C.UTF-8

WORKDIR /srv/jekyll
VOLUME /srv/jekyll
EXPOSE 35729
EXPOSE 4000

CMD [ "bundle", "install" ]
11 changes: 11 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3'
services:
tum_projects:
build: .
volumes:
- ..:/srv/jekyll
environment:
JEKYLL_ENV: production
ports:
- '4000:4000'
command: bash -c "bundle install && bundle exec jekyll serve --host 0.0.0.0"

0 comments on commit dae547f

Please sign in to comment.