-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (29 loc) · 957 Bytes
/
Dockerfile
File metadata and controls
39 lines (29 loc) · 957 Bytes
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
# Build stage
FROM docker.io/ruby:3.3-slim AS builder
# Install system dependencies
RUN apt-get update -qq && apt-get install -y --no-install-recommends \
build-essential \
git \
curl \
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
# Gem isolation
ENV BUNDLE_PATH=/usr/local/bundle
ENV BUNDLE_BIN=/usr/local/bundle/bin
ENV PATH="${BUNDLE_BIN}:/node_modules/.bin:${PATH}"
# Install dependencies outside of /app for volume mount compatibility
COPY package.json package-lock.json /
RUN cd / && npm install
COPY Gemfile Gemfile.lock /
RUN bundle install
WORKDIR /app
# Copy the rest of the application
COPY . .
# Build Tailwind CSS (will find node_modules in /)
RUN npm run build:css
# Make serve.sh executable
RUN chmod +x /app/scripts/serve.sh
EXPOSE 4000
# Default command to serve Jekyll using serve.sh
CMD ["./scripts/serve.sh","--host","::"]