Skip to content

Build development environment with docker

Sergi Alonso edited this page Apr 2, 2024 · 10 revisions

Clone repository, on your development directory

git clone [email protected]:coopdevs/timeoverflow.git

Install docker and docker-compose

I used this guide for Manjaro Linux, look for other guides for your OS

And for docker-compose (Manjaro Linux)

pamac install docker-compose

Edit your Docker Compose file docker-compose.yml (on the root directory of timeoverflow repository)

Add: app path to you local repository and RAILS_ENV=development, like:

version: '3'
services:
  app:
    build: .
    volumes:
      - ./entrypoint.sh:/app/entrypoint.sh
      - ./db/seeds.rb:/app/db/seeds.rb
      - ./storage:/app/storage
      - .:/app:/yourpath/dev/timeoverflow/
    environment:
      - DATABASE_URL=postgres://postgres:timeoverflow@db/timeoverflow
      - SECRET_KEY_BASE=d2a645fb46fbd3d4380fb22230ddea4062570eb00853ca5dfe97f8bb1cbff1ad6891c573a4b4b06beb2d0baf59afc9e00794314490a644fc5808ad6cbc3a6379
      - FORCE_SSL=false
      - RAILS_LOG_LEVEL=debug
      - REDIS_URL=redis://redis:6379/0
      - [email protected]
      - RAILS_ENV=development

Run docker from directory of timeoverflow repository

docker compose up

Sometimes is needed with build (full docker rebuild)

docker compose up --build

Open app on your browser

http://localhost:3000/