Skip to content
Daniel Rosatto edited this page Nov 1, 2019 · 15 revisions

GIDAPPF wiki

Teniendo un linux con las siguientes dependencias:

  • docker
  • docker-compose
  • git

Se clona el proyecto con

  $ git clone https://github.com/unajpps2018asc/GIDAPPF.git
  $ cd GIDAPPF/gidappf
  $ systemctl start docker #(para encender el proceso de docker si no se habilito antes)

GENERAR UN ARCHIVO gidappf/.env, debe ser compatible con Rails 5, postgres, redis, cable y sidekiq. Por ejemplo:

.env

TZ=America/Argentina/Buenos_Aires
DOCKER_HOST=unix:///var/run/docker.sock
COMPOSE_PROJECT_NAME=gidappf
# What Rails environment are we in?
#RAILS_ENV=production
RAILS_ENV=development
#RAILS_ENV=test
# Rails log level.
#   Accepted values: debug, info, warn, error, fatal, or unknown
LOG_LEVEL=debug
RAILS_SERVE_STATIC_FILES=true
# RAILS_MASTER_KEY=32chars.UncommentWhenNotExistFile:config/master.key
# You would typically use `rails secret` to generate a secure token. It is
# critical that you keep this value private in production.
SECRET_TOKEN=forPreviusVersion
# More details about these Puma variables can be found in config/puma.rb.
# Which address should the Puma app server bind to?
BIND_ON=0.0.0.0:3000
# Puma supports multiple threads but in development mode you'll want to use 1
# thread to ensure that you can properly debug your application.
RAILS_MAX_THREADS=1
# Puma supports multiple workers but you should stick to 1 worker in dev mode.
WEB_CONCURRENCY=1
# Requests that exceed 5 seconds will be terminated and dumped to a stacktrace.
# Feel free to modify this value to fit the needs of your project, but if you
# have any request that takes more than 5 seconds you probably need to re-think
# what you are doing 99.99% of the time.
RACK_TIMEOUT_SERVICE_TIMEOUT=5
# Required by the Postgres Docker image. This sets up the initial database when
# you first run it.
POSTGRES_USER=gidappf
POSTGRES_PASSWORD=typethepassword
# Para borrar la base de datos de prodiction: Reiniciar con esta variable habilitada
# DISABLE_DATABASE_ENVIRONMENT_CHECK=1
# The database name will automatically get the Rails environment appended to it
# such as: gidappf_development or gidappf_production.
DATABASE_URL=postgresql://gidappf:typethepassword@postgres:5432/gidappf?encoding=utf8&pool=5&timeout=5000
# The full Redis URL for the Redis cache.
REDIS_PASSWORD=typethepassword
REDIS_CACHE_URL=redis://:typethepassword@redis:6379/0
# The namespace used by the Redis cache.
REDIS_CACHE_NAMESPACE=cache
# Action mailer (e-mail) settings.
# You will need to enable less secure apps in your Google account if you plan
# to use GMail as your e-mail SMTP server.
# You can do that here: https://www.google.com/settings/security/lesssecureapps
SMTP_ADDRESS=smtp.provider.intl
SMTP_PORT=000
SMTP_DOMAIN=provider.intl
SMTP_AUTH=login
SMTP_ENABLE_STARTTLS_AUTO=true
# Not running Docker natively? Replace 'localhost' with your Docker Machine IP
# address, such as: 192.168.99.100:3000
GIDAPPF_PUBLIC_IP=999.999.999.999
GIDAPPF_SYSADMIN=sysadmin@sys.admin
#Url para link de acceso para emails enviados
ACTION_MAILER_HOST=999.999.999.999:3000
ACTION_MAILER_DEFAULT_FROM=your.favorite@email.intl
ACTION_MAILER_DEFAULT_TO=your.favorite@email.intl
# Google Analytics universal ID. You should only set this in non-development
# environments. You wouldn't want to track development mode requests in GA.
# GOOGLE_ANALYTICS_UA='xxx'
# The full Redis URL for Active Job.
ACTIVE_JOB_URL=redis://:typethepassword@redis:6379/0
# The queue prefix for all Active Jobs. The Rails environment will
# automatically be added to this value.
ACTIVE_JOB_QUEUE_PREFIX=gidappf_jobs
# The full Redis URL for Action Cable's back-end.
ACTION_CABLE_BACKEND_URL=redis://:typethepassword@redis:6379/0
# The full WebSocket URL for Action Cable's front-end.
# Not running Docker natively? Replace 'localhost' with your Docker Machine IP
# address, such as: ws://192.168.99.100:28080
ACTION_CABLE_FRONTEND_URL=ws://localhost:28080
# Comma separated list of RegExp origins to allow connections from.
# These values will be converted into a proper RegExp, so omit the / /.
# Examples:
#   http:\/\/localhost*
#   http:\/\/example.*,https:\/\/example.*
## Not running Docker natively? Replace 'localhost' with your Docker Machine IP
# address, such as: http:\/\/192.168.99.100*
ACTION_CABLE_ALLOWED_REQUEST_ORIGINS=http:\/\/localhost*

Luego arrancar el proyecto con:

  $ docker-compose up --build -d && docker-compose exec --user "$(id -u):$(id -g)" website rails db:setup && sudo rm -r storage/!(seeds)

  • AHORA SE PUEDE VISITAR EL SITIO http://localhost:3000 y crear el primmer usuario admin.
  • Si es necesario poblar de datos el sistema en segundo plano es posible. Para ello hay que editar el archivo gidappf/db/seeds/populate_show.rb convenientemente y luego ejecutar el siguiente comando:
  $ docker-compose exec --user "$(id -u):$(id -g)" website rake db:seed:populate_show && docker-compose exec --user "$(id -u):$(id -g)"  website rake documents_collector:schedule_init
  • Si se apaga el servidor anfitrión y es necesario reiniciar el sistema, ejecutar en la terminal:
  $ docker-compose up -d
Clone this wiki locally