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

Feature: Align Bioportal and AgroPortal - part 1 - Configuration code and Docker #21

Merged
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
25 changes: 25 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.git/
log/*
!log/.keep
app/assets/builds/*
!app/assets/builds/.keep
node_modules/
public/assets/
storage/*
!storage/.keep
tmp/*
!tmp/.keep

.bundle
.byebug_history
.dockerignore
.env*
!.env.example
config/master.key
docker-compose.override.yml
yarn-error.log
yarn-debug.log*
.yarn-integrity

config/credentials/*
config/credentials.yml.enc
43 changes: 43 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
##################### UI configuration ####################
RAILS_ENV=development
SITE=Testportal
ORG=LIRMM
ORG_URL=http://www.lirmm.fr

UI_URL=http://localhost:3000
API_URL=http://localhost:9393
API_KEY=

UI_THEME=ontoportal

BIOMIXER_URL=
BIOMIXER_APIKEY=

ANNOTATOR_URL=

FAIRNESS_DISABLED=false
FAIRNESS_URL=

NCBO_ANNOTATORPLUS_ENABLED=false
NCBO_ANNOTATOR_URL=
NCBO_API_KEY=

[email protected]
RELEASE_VERSION="OntoPortal Appliance 3.0.1"

ANALYTICS_ID=
USE_RECAPTCHA=false
#################### Buidling the API for running tests ####################
## An ontology that will be imported in the starting of the API server
STARTER_ONTOLOGY=STY
## API key of a remote API used to download the starter ontology
OP_API_KEY=8b5b7825-538d-40e0-9e9e-5ab9274a9aeb
## API url of the remote API used to download the starter ontology
OP_API_URL="https://data.bioontology.org"

## Image repositroy from which the ontoportal api will be built
API_IMAGE_REPOSITORY=agroportal
## Image tag/version from which the ontoportal api will be built
API_IMAGE_TAG=master


26 changes: 16 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ rerun.txt
pickle-email-*.html
config/bioportal_config*.rb
config/database.yml
config/secrets.yml
config/deploy/*
config/locales/en.rb
config/secrets.yml
**.DS_Store
/public/**/cache/**
/public/umls/*
Expand All @@ -28,23 +29,28 @@ nohup.out
# Ignore editor files
.idea
*.swp
.rbenv-gemsets

.tags

.tags_sorted_by_file

config/newrelic.yml

node_modules

# Ignore keys for decrypting credentials
/config/credentials/development.key
/config/credentials/test.key
/config/credentials/staging.key
/config/credentials/production.key
/config/credentials/appliance.key
.env
config/site_config.rb
docker-sync.yml
.docker-sync/daemon.log
.docker-sync/daemon.pid

/app/assets/builds/*
!/app/assets/builds/.keep

/node_modules

# Encryption keys
/config/master.key
/config/credentials/development.key
/config/credentials/test.key
/config/credentials/staging.key
/config/credentials/production.key
/config/credentials/appliance.key
53 changes: 53 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Make sure it matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=3.2.0
FROM ruby:${RUBY_VERSION}-alpine

# Install libvips for Active Storage preview support
RUN apk add --no-cache build-base \
libxml2-dev \
libxslt-dev \
mariadb-dev \
git \
tzdata \
nodejs yarn \
less \
bash \
docker \
docker-compose \
&& mkdir /node_modules

# Rails app lives here
WORKDIR /app

# Set production environment
ARG RAILS_ENV="production"
ARG BUNDLE_WITHOUT="development test"

ENV RAILS_LOG_TO_STDOUT="1" \
RAILS_SERVE_STATIC_FILES="true" \
RAILS_ENV="${RAILS_ENV}" \
BUNDLE_PATH=/usr/local/bundle \
BUNDLE_WITHOUT="${BUNDLE_WITHOUT}"

RUN gem update --system 3.4.22 # the 3.4.22 can be removed if we support Ruby version > 3.0

COPY . .

RUN bundle install
RUN yarn install && yarn build



RUN cp config/bioportal_config_env.rb.sample config/bioportal_config_production.rb
RUN cp config/bioportal_config_env.rb.sample config/bioportal_config_development.rb
RUN cp config/database.yml.sample config/database.yml

# Precompile bootsnap code for faster boot times
RUN bundle exec bootsnap precompile --gemfile app/ lib/

RUN SECRET_KEY_BASE_DUMMY="1" ./bin/rails assets:precompile

ENV BINDING="0.0.0.0"
EXPOSE 3000

CMD ["bash"]
Loading
Loading