Skip to content

Commit 37a2589

Browse files
author
Adrian Auer
committed
added devContainer Support and moved all Container related Issues intto the Dockerfile
1 parent dea5087 commit 37a2589

File tree

3 files changed

+35
-5
lines changed

3 files changed

+35
-5
lines changed

.devcontainer/devcontainer.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "ACADEMIC PAGES",
3+
"dockerComposeFile": "../docker-compose.yaml",
4+
"service": "jekyll-site",
5+
"remoteEnv": {
6+
"VSCODE_SERVER_DIR": "/home/vscode/.vscode-server"
7+
},
8+
"runArgs": [
9+
"--user",
10+
"1000:1000"
11+
],
12+
"workspaceFolder": "/usr/src/app",
13+
"remoteUser": "vscode"
14+
}

Dockerfile

100644100755
Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,29 @@ RUN apt-get update && apt-get install -y \
77
nodejs \
88
&& rm -rf /var/lib/apt/lists/*
99

10-
# Set the working directory inside the container
10+
11+
# Create a non-root user with UID 1000
12+
RUN groupadd -g 1000 vscode && \
13+
useradd -m -u 1000 -g vscode vscode
14+
15+
# Set the working directory
1116
WORKDIR /usr/src/app
1217

18+
# Set permissions for the working directory
19+
RUN chown -R vscode:vscode /usr/src/app
20+
21+
# Switch to the non-root user
22+
USER vscode
23+
1324
# Copy Gemfile into the container (necessary for `bundle install`)
1425
COPY Gemfile ./
1526

27+
28+
1629
# Install bundler and dependencies
17-
RUN gem install bundler:2.3.26 && bundle install
30+
RUN gem install connection_pool:2.5.0
31+
RUN gem install bundler:2.3.26
32+
RUN bundle install
1833

1934
# Command to serve the Jekyll site
2035
CMD ["jekyll", "serve", "-H", "0.0.0.0", "-w", "--config", "_config.yml,_config_docker.yml"]

docker-compose.yaml

100644100755
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ services:
22
jekyll-site:
33
image: jekyll-site
44
build: .
5-
volumes: [.:/usr/src/app]
6-
ports: [4000:4000]
5+
volumes: [ .:/usr/src/app ]
6+
ports: [ 4000:4000 ]
77
user: 1000:1000
8-
environment: [JEKYLL_ENV=docker]
8+
environment: [ JEKYLL_ENV=docker ]
9+
command: jekyll serve -H 0.0.0.0 -w --config _config.yml, _config_docker.yml

0 commit comments

Comments
 (0)