Skip to content

Commit 3dffc00

Browse files
Add docker and Makefiles
1 parent 8e16a5e commit 3dffc00

3 files changed

Lines changed: 51 additions & 0 deletions

File tree

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM ruby:4.0.1 AS base
2+
3+
RUN bundle config set frozen 'true' && \
4+
bundle config set path '/vendor/bundle'
5+
6+
WORKDIR /usr/src/app
7+
8+
COPY Gemfile Gemfile.lock ./
9+
RUN bundle install
10+
11+
COPY . .
12+
13+
FROM base AS build-step
14+
RUN bundle exec jekyll build
15+
16+
FROM scratch AS build
17+
COPY --from=build-step /usr/src/app/_site /
18+
19+
FROM base AS server
20+
EXPOSE 4000
21+
CMD bundle exec jekyll serve --host 0.0.0.0 --port 4000 --destination /tmp/_site

Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.PHONY: all build serve clean
2+
3+
all: build
4+
5+
build: clean
6+
docker buildx build . --target build --output type=local,dest=./_site
7+
8+
serve:
9+
docker compose up --build
10+
11+
clean:
12+
rm -rf _site
13+
14+
fmt:
15+
npm run format:fix
16+
17+
lint:
18+
npm run lint:fix
19+
20+
spellcheck:
21+
npm run spellcheck:staged

docker-compose.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
services:
2+
jekyll:
3+
build:
4+
context: .
5+
target: server
6+
volumes:
7+
- "./:/usr/src/app"
8+
ports:
9+
- "4000:4000"

0 commit comments

Comments
 (0)