generated from academicpages/academicpages.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
executable file
·35 lines (24 loc) · 840 Bytes
/
Dockerfile
File metadata and controls
executable file
·35 lines (24 loc) · 840 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
# 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 Gemfile into the container (necessary for `bundle install`)
COPY Gemfile ./
# Install bundler and dependencies
RUN gem install connection_pool:2.5.0
RUN gem install bundler:2.3.26
RUN bundle install
# Command to serve the Jekyll site
CMD ["jekyll", "serve", "-H", "0.0.0.0", "-w", "--config", "_config.yml,_config_docker.yml"]