-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
feat: add docker support
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.git | ||
node_modules/ | ||
docker-compose.yml | ||
Dockerfile | ||
.gitignore | ||
.editorconfig | ||
README.md | ||
Taskfile.dist.yml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Stage 1: Build node environment | ||
FROM node:20.2.0-alpine AS builder | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Install pnpm | ||
RUN npm install --global pnpm | ||
|
||
# Copy the package.json and lock file | ||
COPY package.json pnpm-lock.yaml ./ | ||
|
||
# Install dependencies | ||
RUN pnpm install | ||
|
||
# Copy rest of the application source code | ||
COPY . . | ||
|
||
# Build the application | ||
RUN pnpm run build | ||
|
||
# Stage 2: Build Ruby environment | ||
FROM ruby:2.7 | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Copy Gemfile and Gemfile.lock | ||
COPY Gemfile Gemfile.lock ./ | ||
|
||
# Install bundle dependencies | ||
RUN bundle install | ||
|
||
# Copy rest of the application source code | ||
COPY . . | ||
|
||
# Copy built node app from the builder stage | ||
COPY --from=builder /app . | ||
|
||
# Build Jekyll site | ||
RUN bundle exec jekyll build | ||
|
||
# Expose port 4000 for the app | ||
EXPOSE 4000 | ||
|
||
# Expose LiveReload port | ||
EXPOSE 35729 | ||
|
||
# Run the app when the container launches | ||
CMD ["bundle", "exec", "jekyll", "serve", "--livereload", "--host=0.0.0.0"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,6 +62,7 @@ GEM | |
unicode-display_width (1.8.0) | ||
|
||
PLATFORMS | ||
ruby | ||
x86_64-linux | ||
|
||
DEPENDENCIES | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
version: '3' | ||
|
||
tasks: | ||
build: | ||
label: docker:build | ||
desc: Build Docker images and cache dependencies | ||
cmds: | ||
- docker-compose build {{ .CLI_ARGS }} | ||
|
||
up: | ||
label: docker:up | ||
desc: Start Docker containers in the background | ||
cmds: | ||
- docker-compose up --no-build --remove-orphans --detach {{ .CLI_ARGS }} | ||
|
||
restart: | ||
label: docker:restart | ||
desc: Restart Docker containers | ||
cmds: | ||
- docker-compose restart {{ .CLI_ARGS }} | ||
|
||
stop: | ||
label: docker:stop | ||
desc: Stop Docker containers | ||
cmds: | ||
- docker-compose stop {{ .CLI_ARGS }} | ||
|
||
down: | ||
label: docker:down | ||
desc: Stop and remove Docker containers, networks | ||
cmds: | ||
- docker-compose down {{ .CLI_ARGS }} | ||
|
||
exec: | ||
label: docker:exec | ||
desc: Run a command inside a running container | ||
cmds: | ||
- docker-compose exec {{ .CLI_ARGS }} | ||
interactive: true | ||
|
||
logs: | ||
label: docker:logs | ||
desc: Stream the logs of all Docker containers | ||
cmds: | ||
- docker-compose logs -f {{ .CLI_ARGS }} | ||
interactive: true |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Large diffs are not rendered by default.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Large diffs are not rendered by default.