-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
KHOUBZA Younes
committed
May 29, 2023
1 parent
8bc62f5
commit 72631d9
Showing
3 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: '3' | ||
|
||
services: | ||
web: | ||
build: . | ||
volumes: | ||
- .:/app | ||
ports: | ||
- "4000:4000" | ||
- "35729:35729" | ||
|
||
watch: | ||
build: . | ||
command: [ "pnpm", "run", "watch" ] | ||
volumes: | ||
- .:/app | ||
ports: | ||
- "35729:35729" |