Skip to content
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

feat: dockerization for development environment #77

Closed
wants to merge 4 commits into from
Closed
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
38 changes: 38 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Bridgetown
output
.bridgetown-cache
.bridgetown-metadata
.bridgetown-webpack
.routes.json

# Dependency folders
node_modules
bower_components
vendor

# Caches
.sass-cache
.npm
.node_repl_history

# Ignore bundler config.
/.bundle

# Ignore Byebug command history file.
.byebug_history

# dotenv environment variables file
.env

# Mac files
.DS_Store

# Yarn
yarn-error.log
yarn-debug.log*
.pnp/
.pnp.js
# Yarn Integrity file
.yarn-integrity

frontend/styles/jit-refresh.css
85 changes: 85 additions & 0 deletions Docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
## Docker Development Environment

---

### Windows
**Prerequisites**
| Name | Version | Installation |
| --- | --- | --- |
| Git | Latest | [Download & Install](https://git-scm.com/downloads) |
| Docker | Latest | [Follow this guide to install](https://docs.docker.com/desktop/install/windows-install/) |

**Steps to setup**
1. Fork current repository
2. Clone the forked repository
```bash
git clone https://github.com/<username>/onebusaway-docs.git
```
3. Open `OneBusAway` directory
4. Open `PowerShell` in the current directory
5. Run
```bash
docker compose up
```
6. Wait for the docker container to be prepared
7. Navigate to `http://localhost:4000` in your browser

If you required to restart the server
- Type `Ctrl+C` in terminal to stop the server
- Run `docker compose up` to start the server again

---

### Linux
**Prerequisites**
| Name | Version | Installation |
| --- | --- | --- |
| Git | Latest | [Download & Install](https://git-scm.com/downloads) |
| Docker Desktop | Latest | [Follow this guide to install](https://docs.docker.com/desktop/install/linux-install/) |
| Docker Engine | Latest | [Follow this guide to install](https://docs.docker.com/engine/install/) |

**NOTE:** You can install any of Docker Desktop or Docker Engine.

**Steps to setup**
1. Fork current repository
2. Clone the forked repository
```bash
git clone https://github.com/<username>/onebusaway-docs.git
```
3. Open `OneBusAway` directory
4. Open `Terminal` in the current directory
5. Run
``` bash
docker compose up
```

If you required to restart the server
- Type `Ctrl+C` in terminal to stop the server
- Run `docker compose up` to start the server again

---

### macOS
**Prerequisites**
| Name | Version | Installation |
| --- | --- | --- |
| Git | Latest | [Download & Install](https://git-scm.com/downloads) |
| Docker | Latest | [Follow this guide to install](https://docs.docker.com/desktop/mac/install/) |

**Steps to setup**
1. Fork current repository
2. Clone the forked repository
```bash
git clone https://github.com/<username>/onebusaway-docs.git
```
3. Open `OneBusAway` directory
4. Open `Terminal` in the current directory
5. Run
```bash
docker compose up
```
If you required to restart the server
- Type `Ctrl+C` in terminal to stop the server
- Run `docker compose up` to start the server again

---
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Use ruby alpine as base image
FROM ruby:3.3.0-alpine

# Install build dependencies
RUN apk add --no-cache build-base nodejs yarn curl

# Set the working directory in the container to /app
WORKDIR /app

# copy the gemfile
COPY Gemfile Gemfile.lock ./

# Install Gems
RUN bundle install

# copy package.json and yarn.lock
COPY package.json yarn.lock ./

# Install packages with yarn
RUN yarn install

# Copy code to the container
COPY . .

# Make port 4000 available to the world outside this container
EXPOSE 4000

# Run bin/bridgetown when the container launches
CMD ["bin/bridgetown", "start"]
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,19 @@ Want to help improve the documentation? Thank you! You can easily improve the of

## Develop New Features/Fix Bugs

### Prerequisites

### Install with Docker
There are several ways to run your own instance of OneBusAway Developer Documentation:

| Method | Operating System | Documentation |
| --- | --- | --- |
| Docker Development Environment | Windows | [Click Here](Docker.md#windows) |
| Docker Development Environment | Linux | [Click Here](Docker.md#linux) |
| Docker Development Environment | Mac | [Click Here](Docker.md#macos) |

### Install Manually

#### Prerequisites

Ensure you have the following installed on your system:

Expand Down Expand Up @@ -119,6 +131,3 @@ This project exists because of all the people who have contributed.

We are all humans trying to work together to improve the community. Let's always be kind and appreciate the importance of making compromises. ❤️




9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: '3.8'

services:
web:
build: .
ports:
- '4000:4000'
volumes:
- .:/app
Loading