Skip to content

Commit e66f5fb

Browse files
committed
Docker fixes
1 parent 932125c commit e66f5fb

File tree

3 files changed

+30
-17
lines changed

3 files changed

+30
-17
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
"remoteEnv": {
66
"VSCODE_SERVER_DIR": "/home/vscode/.vscode-server"
77
},
8-
"runArgs": [
9-
"--user",
10-
"1000:1000"
11-
],
128
"workspaceFolder": "/usr/src/app",
13-
"remoteUser": "vscode",
9+
"remoteUser": "root",
1410
"forwardPorts": [4000] // Add port forwarding
1511
}

Dockerfile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,19 @@ RUN chown -R vscode:vscode /usr/src/app
2222
USER vscode
2323

2424
# Copy Gemfile into the container (necessary for `bundle install`)
25-
COPY Gemfile ./
25+
COPY Gemfile Gemfile.lock ./
2626

2727

28+
RUN gem install bundler:2.3.26 \
29+
&& bundle config set deployment 'true' \
30+
&& bundle config set path '/usr/local/bundle' \
31+
&& bundle install --without development test
2832

2933
# Install bundler and dependencies
30-
RUN gem install connection_pool:2.5.0
31-
RUN gem install bundler:2.3.26
32-
RUN bundle install
34+
#RUN gem install connection_pool:2.5.0
35+
#RUN gem install bundler:2.3.26
36+
#RUN bundle install
3337

3438
# Command to serve the Jekyll site
35-
CMD ["jekyll", "serve", "-H", "0.0.0.0", "-w", "--config", "_config.yml,_config_docker.yml"]
39+
CMD ["bash", "-lc", "bundle exec jekyll serve -H 0.0.0.0 -w --config _config.yml,_config_docker.yml"]
40+
#CMD ["jekyll", "serve", "-H", "0.0.0.0", "-w", "--config", "_config.yml,_config_docker.yml"]

docker-compose.yaml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
services:
22
jekyll-site:
3-
image: jekyll-site
4-
build: .
5-
volumes: [ .:/usr/src/app ]
6-
ports: [ 4000:4000 ]
7-
user: 1000:1000
8-
environment: [ JEKYLL_ENV=docker ]
9-
command: jekyll serve -H 0.0.0.0 -w --config _config.yml,_config_docker.yml
3+
build:
4+
context: .
5+
dockerfile: Dockerfile
6+
# use the bundle-installed jekyll:
7+
command: ["bash","-lc","bundle exec jekyll serve -H 0.0.0.0 -w --config _config.yml,_config_docker.yml"]
8+
ports:
9+
- "4000:4000"
10+
volumes:
11+
- ./:/usr/src/app
12+
# REMOVE any 'user: 1000:1000' line here (the image already sets USER)
13+
14+
#services:
15+
# jekyll-site:
16+
# image: jekyll-site
17+
# build: .
18+
# volumes: [ .:/usr/src/app ]
19+
# ports: [ 4000:4000 ]
20+
# environment: [ JEKYLL_ENV=docker ]
21+
# command: jekyll serve -H 0.0.0.0 -w --config _config.yml,_config_docker.yml

0 commit comments

Comments
 (0)