-
Notifications
You must be signed in to change notification settings - Fork 33
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
1 parent
6af4174
commit 73ce995
Showing
1 changed file
with
1 addition
and
21 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 |
---|---|---|
@@ -1,40 +1,20 @@ | ||
# Stage 1: Build and install Node.js dependencies | ||
FROM node:18-alpine as nodebuilder | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Copy package.json and package-lock.json (or yarn.lock if you use Yarn) | ||
COPY app/package.json app/package-lock.json ./ | ||
|
||
# Install dependencies | ||
RUN npm install | ||
|
||
# Optionally, if your application needs to be built: | ||
# COPY app/ ./ | ||
# RUN npm run build | ||
RUN npm install | ||
|
||
# Stage 2: Setup the final image with Jekyll and Node.js environment | ||
FROM tiryoh/jekyll:4.2.1 | ||
|
||
# Copy Node.js build artifacts from the previous stage | ||
COPY --from=nodebuilder /app/node_modules /srv/jekyll/node_modules | ||
|
||
# Copy your application code, if there's anything to run directly | ||
# COPY --from=nodebuilder /app /srv/jekyll | ||
|
||
# Set the working directory | ||
WORKDIR /srv/jekyll | ||
|
||
# Add Node.js and npm to PATH | ||
ENV PATH="/srv/jekyll/node_modules/.bin:${PATH}" | ||
|
||
# Continue setting up your Jekyll environment | ||
# For example, copy over your Jekyll site files | ||
# COPY . /srv/jekyll | ||
|
||
# Expose the port Jekyll will run on | ||
EXPOSE 8080 | ||
|
||
# Command to run your Jekyll site | ||
CMD ["jekyll", "build", "--watch"] |