Skip to content

Commit

Permalink
Setup Docker for Local Development Environment (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
MattPereira authored Jun 22, 2023
1 parent 782a250 commit 5e5bde5
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# https://hub.docker.com/_/ruby
FROM ruby:3.0

# throw errors if Gemfile has been modified since Gemfile.lock
RUN bundle config --global frozen 1

WORKDIR /usr/src/app

# copy gems first to cache bundle install
COPY Gemfile Gemfile.lock ./
RUN bundle install

# copy whole repo into the image
COPY . .
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '3'
services:
jekyll:
container_name: jekyll-server
build:
context: .
dockerfile: Dockerfile
image: merl-center:v1
# host flag allows Jekyll server to be accessed from outside the container
command: bundle exec jekyll serve --livereload --host=0.0.0.0
# volume allows changes to be seen on localhost immediately instead of having to delete and rebuild image
volumes:
- .:/usr/src/app
ports:
- 4000:4000
- 35729:35729 # port for livereload

0 comments on commit 5e5bde5

Please sign in to comment.