Skip to content
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
24 changes: 22 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,15 @@ Help would be appreciated! Please join us in [slack #flaredown](https://rubyforg
* Redis 6.2.3
* Ruby 3.0.6 (see [RVM](https://rvm.io/) also)
* Node 12.22.6

## Installation

All dependencies are dockerized, including the application and can be run using `docker compose` so there's no dependencies to install other than docker.

If you want to run the application on your own machine see the next sections on dependency installations

### Mac

_If you are running on an M1 mac, run the following command before you start the installation process:_
```bash
$env /usr/bin/arch -arm64 /bin/zsh ---login
Expand Down Expand Up @@ -54,7 +61,22 @@ npm install

## Running / Development

### Docker

From the project root:

```bash
docker compose --profile dev up
```

This will build and run all the containers necessary to run the application locally.

Visit your app at [http://localhost:4300](http://localhost:4300)

### Local Machine Installation

From the project root:

```bash
docker compose up
```
Expand All @@ -63,8 +85,6 @@ docker compose up
rake run
```

Visit your app at [http://localhost:4300](http://localhost:4300)

## CI

Several checks are configured to run on all commits using Github Actions, including lint, build and test steps. Definitions can be found in [./github/workflows](./github/workflows). Those checks which always run are required to be successful for PRs to be mergable.
Expand Down
23 changes: 23 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM ruby:3.0

# set working directory
WORKDIR /app

# install dependencies
RUN apt-get update -qq && \
apt-get install -y nodejs postgresql-client

# install bundler
RUN gem install bundler:2.1.4

# copy the Gemfile and Gemfile.lock to the container
COPY Gemfile Gemfile.lock ./

# install the gems
RUN bundle install

# copy the rest of the application files to the container
COPY . .

# start the server
CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]
2 changes: 1 addition & 1 deletion backend/config/database.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
default: &default
adapter: postgresql
encoding: unicode
host: localhost
host: <%= ENV.fetch('PG_DATABASE_HOST') { 'localhost' } %>
database: flaredown_development
username: postgres
password: password
Expand Down
2 changes: 1 addition & 1 deletion backend/config/mongoid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ development:
# Provides the hosts the default client can connect to. Must be an array
# of host:port pairs. (required)
hosts:
- localhost:27017
- <%= ENV['MONGODB_HOST'] || "localhost" %>:27017
options:
# Change the default write concern. (default = { w: 1 })
# write:
Expand Down
82 changes: 71 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,87 @@
version: '3'
volumes:
postgres:
mongodb:
redis:
version: '3.8'
x-backend-services-hosts:
&backend-services-hosts
MONGODB_HOST: mongodb
REDIS_URL: redis://redis:6379
PG_DATABASE_HOST: postgres

services:
backend:
build: backend
depends_on:
- postgres
- mongodb
- redis
ports:
- 3000:3000
volumes:
- ./backend:/app
environment: *backend-services-hosts
profiles:
- dev
workers:
build: backend
command: bundle exec sidekiq -C config/sidekiq.yml
depends_on:
- redis
- mongodb
- postgres
volumes:
- ./backend:/app
environment: *backend-services-hosts
profiles:
- dev
tunnel:
build: backend
command: bundle exec bin/localtunnel
depends_on:
- backend
volumes:
- ./backend:/app
profiles:
- tunnel
frontend:
build: frontend
depends_on:
- backend
ports:
- 4300:4300
volumes:
- ./frontend:/app
command: sh -c "cd /app && rm -rfd ./dist && ./node_modules/.bin/ember serve --port 4300 --proxy http://localhost:3000"
profiles:
- dev
app-setup:
build: backend
command: bundle exec rails app:setup
depends_on:
- postgres
environment: *backend-services-hosts
profiles:
- tools
postgres:
image: postgres:12.8-alpine
restart: always
environment:
POSTGRES_PASSWORD: password
PGDATA: /data
volumes:
- postgres:/data
ports:
- 5432:5432
expose:
- 5432
mongodb:
image: mongo:4.4.9
volumes:
- mongodb:/data/db
ports:
- 27017:27017
expose:
- 27017
redis:
image: redis:6.2.3-alpine
volumes:
- redis:/data
ports:
- 6379:6379
expose:
- 6379
volumes:
postgres:
mongodb:
redis:
8 changes: 8 additions & 0 deletions frontend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
bower_components
node_modules
dist
tmp
.git
README.md
LICENSE
.gitignore
14 changes: 14 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:12.22.6

# Force npm version 7
RUN npm i -g npm@7

WORKDIR /app

COPY package*.json bower.json .bowerrc .npmrc ./

RUN npm install

COPY . .

CMD ["npm", "start"]
3 changes: 1 addition & 2 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ You will need the following things properly installed on your computer.
## Running / Development

* `ember serve`
* Visit your app at [http://localhost:4200](http://localhost:4200).
* Visit your app at [http://localhost:4300](http://localhost:4300).

## Running / Development via Fastboot server

Expand Down Expand Up @@ -54,4 +54,3 @@ Specify what it takes to deploy your app.
* Development Browser Extensions
* [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi)
* [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/)