-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
executable file
·32 lines (23 loc) · 801 Bytes
/
Copy pathDockerfile
File metadata and controls
executable file
·32 lines (23 loc) · 801 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
# Base image: Ruby with necessary dependencies for Jekyll
FROM ruby:3.2
# Install dependencies
RUN apt-get update && apt-get install -y \
build-essential \
nodejs \
&& rm -rf /var/lib/apt/lists/*
# Create a non-root user with UID 1000
RUN groupadd -g 1000 vscode && \
useradd -m -u 1000 -g vscode vscode
# Set the working directory
WORKDIR /usr/src/app
# Set permissions for the working directory
RUN chown -R vscode:vscode /usr/src/app
# Switch to the non-root user
USER vscode
# Copy dependency manifests so bundle install uses the locked versions
COPY Gemfile Gemfile.lock ./
# Install bundler and dependencies (match Gemfile.lock)
RUN gem install bundler:2.4.19
RUN bundle _2.4.19_ install
# Command to serve the Jekyll site
CMD ["jekyll", "serve", "-H", "0.0.0.0", "-w"]