Skip to content

added chmod to docu and connection_pool to gemfile #2981

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "ACADEMIC PAGES",
"dockerComposeFile": "../docker-compose.yaml",
"service": "jekyll-site",
"remoteEnv": {
"VSCODE_SERVER_DIR": "/home/vscode/.vscode-server"
},
"runArgs": [
"--user",
"1000:1000"
],
"workspaceFolder": "/usr/src/app",
"remoteUser": "vscode",
"forwardPorts": [4000] // Add port forwarding
}
19 changes: 17 additions & 2 deletions Dockerfile
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,29 @@ RUN apt-get update && apt-get install -y \
nodejs \
&& rm -rf /var/lib/apt/lists/*

# Set the working directory inside the container

# 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 bundler:2.3.26 && bundle install
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"]
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ group :jekyll_plugins do
end

gem 'github-pages'
gem 'connection_pool', '2.5.0'
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ See more info at https://academicpages.github.io/
When you are initially working on your website, it is very useful to be able to preview the changes locally before pushing them to GitHub. To work locally you will need to:

1. Clone the repository and made updates as detailed above.

### Using a different IDE
1. Make sure you have ruby-dev, bundler, and nodejs installed

On most Linux distribution and [Windows Subsystem Linux](https://learn.microsoft.com/en-us/windows/wsl/about) the command is:
Expand Down Expand Up @@ -59,11 +61,16 @@ Working from a different OS, or just want to avoid installing dependencies? You
You can build and execute the container by running the following command in the repository:

```bash
chmod -R 777 .
docker compose up
```

You should now be able to access the website from `localhost:4000`.

### Using the DevContainer in VS Code

If you are using [Visual Studio Code](https://code.visualstudio.com/) you can use the [Dev Container](https://code.visualstudio.com/docs/devcontainers/containers) that comes with this Repository. Normally VS Code detects that a development coontainer configuration is available and asks you if you want to use the container. If this doesn't happen you can manually start the container by **F1->DevContainer: Reopen in Container**. This restarts your VS Code in the container and automatically hosts your academic page locally on http://localhost:4000. All changes will be updated live to that page after a few seconds.

# Maintenance

Bug reports and feature requests to the template should be [submitted via GitHub](https://github.com/academicpages/academicpages.github.io/issues/new/choose). For questions concerning how to style the template, please feel free to start a [new discussion on GitHub](https://github.com/academicpages/academicpages.github.io/discussions).
Expand Down
7 changes: 4 additions & 3 deletions docker-compose.yaml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ services:
jekyll-site:
image: jekyll-site
build: .
volumes: [.:/usr/src/app]
ports: [4000:4000]
volumes: [ .:/usr/src/app ]
ports: [ 4000:4000 ]
user: 1000:1000
environment: [JEKYLL_ENV=docker]
environment: [ JEKYLL_ENV=docker ]
command: jekyll serve -H 0.0.0.0 -w --config _config.yml, _config_docker.yml