-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
50 lines (34 loc) · 951 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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"]