Skip to content
Open
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
36 changes: 12 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
# Multi-stage dockerfile where the 1st stage builds the app on a specific version of node,
# and the 2nd stage sets up the latest nginx:alpine.

# ============================== node/build section =====================================================
FROM node:8.15-alpine as build_section

ARG REACT_APP_GRAPHQL_API_URL=https://genetics-api.opentargets.io
ARG REACT_APP_PLATFORM_URL=https://targetvalidation.org
ARG REACT_APP_CONTACT_URL=mailto:[email protected]

RUN apk update && apk add --update git
COPY ./ /app/
WORKDIR /app
RUN yarn install && yarn build

# ============================== nginx section =====================================================
FROM nginx:1.16-alpine


# copy nginx configuration file
COPY nginx.conf /etc/nginx/conf.d/default.conf
# copy build result from 1st stage
COPY --from=build_section /app/build/ /usr/share/nginx/html/

FROM node:12 as build
COPY package.json yarn.lock /tmp/genetics-app/
WORKDIR /tmp/genetics-app/
RUN yarn
COPY . /tmp/genetics-app/
RUN yarn build

FROM node:12
RUN npm install -g serve
COPY --from=build /tmp/genetics-app/build/ /var/www/genetics-app/
WORKDIR /var/www/genetics-app/
EXPOSE 80
CMD ["serve", "--no-clipboard", "--single", "-l", "tcp://0.0.0.0:80"]
13 changes: 0 additions & 13 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,3 @@
from = "/*"
to = "/index.html"
status = 200

# qa and dev branches to use different apis
# (as per https://github.com/opentargets/genetics/issues/312)
[context.production.environment]
REACT_APP_GTMID = "GTM-PNQWZ2V"
[context.qa.environment]
REACT_APP_GRAPHQL_API_URL = "https://genetics-api-qa.opentargets.io"
[context.dev.environment]
REACT_APP_GRAPHQL_API_URL = "https://open-targets-genetics.appspot.com"
[context."gp-connect-lt".environment]
REACT_APP_GRAPHQL_API_URL = "https://open-targets-genetics.appspot.com"
[context."gp-intersection".environment]
REACT_APP_GRAPHQL_API_URL = "https://open-targets-genetics.appspot.com"
13 changes: 0 additions & 13 deletions nginx.conf

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
"scripts": {
"start": "react-scripts start",
"build": "REACT_APP_GIT_REVISION=\"$(git rev-parse --short HEAD)\" react-scripts build",
"build": "react-scripts build",
"build:serve": "serve -s build -l 5000",
"test": "react-scripts test --env=jsdom",
"test:coverage": "yarn test --coverage",
Expand Down
6 changes: 4 additions & 2 deletions public/config.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// DevOps context
var configApiUrl = DEVOPS_CONTEXT_PLATFORM_APP_CONFIG_API_URL
var configGoogleTagManagerID = DEVOPS_CONTEXT_PLATFORM_APP_CONFIG_GOOGLE_TAG_MANAGER_ID
var configApiUrl = DEVOPS_CONTEXT_GENETICS_APP_CONFIG_API_URL
var configGoogleTagManagerID = DEVOPS_CONTEXT_GENETICS_APP_CONFIG_GOOGLE_TAG_MANAGER_ID
var configHelpdeskEmail = DEVOPS_CONTEXT_GENETICS_APP_CONFIG_HELPDESK_EMAIL
var configPlatformUrl = DEVOPS_CONTEXT_GENETICS_APP_CONFIG_PLATFORM_URL
1 change: 1 addition & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const config = {
'https://open-targets-genetics-dev.ew.r.appspot.com/graphql',
googleTagManagerID: window.configGoogleTagManagerID ?? null,
helpdeskEmail: window.configHelpdeskEmail ?? '[email protected]',
platformUrl: window.configPlatformUrl ?? 'https://platform.opentargets.org/',
};

export default config;
17 changes: 0 additions & 17 deletions src/configuration.js

This file was deleted.

7 changes: 2 additions & 5 deletions src/constants.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { contactUrl as contactUrlConfig } from './configuration';
import config from './config';

export const pvalThreshold = 4.94e-322;

export const contactUrl = contactUrlConfig;

export const mainMenuItems = [
// Documentation
{
Expand All @@ -27,7 +24,7 @@ export const mainMenuItems = [
// Contact
{
name: 'Contact us',
url: `mailto:[email protected]`,
url: `mailto:${config.helpdeskEmail}`,
external: true,
},
];
Expand Down Expand Up @@ -70,7 +67,7 @@ export const externalLinks = {
{
label: 'Contact',
iconClasses: 'fa fa-envelope',
url: `${contactUrl}`,
url: `mailto:${config.helpdeskEmail}`,
},
],
social: [
Expand Down
12 changes: 6 additions & 6 deletions src/pages/GenePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import BasePage from './BasePage';
import LocusLink from '../components/LocusLink';
import AssociatedStudiesTable from '../components/AssociatedStudiesTable';
import ColocForGeneTable from '../components/ColocForGeneTable';
import { platformUrl } from '../configuration';
import config from '../config';

const GENE_PAGE_QUERY = loader('../queries/GenePageQuery.gql');

Expand Down Expand Up @@ -282,7 +282,7 @@ class GenePage extends React.Component {
<Grid item className={classes.geneInfoItem}>
<a
className={classes.platformLink}
href={`${platformUrl}target/${geneId}`}
href={`${config.platformUrl}target/${geneId}`}
target="_blank"
rel="noopener noreferrer"
>
Expand All @@ -293,7 +293,7 @@ class GenePage extends React.Component {
<Grid item className={classes.geneInfoItem}>
<a
className={classes.platformLink}
href={`${platformUrl}target/${geneId}`}
href={`${config.platformUrl}target/${geneId}`}
target="_blank"
rel="noopener noreferrer"
>
Expand All @@ -304,7 +304,7 @@ class GenePage extends React.Component {
<Grid item className={classes.geneInfoItem}>
<a
className={classes.platformLink}
href={`${platformUrl}target/${geneId}`}
href={`${config.platformUrl}target/${geneId}`}
target="_blank"
rel="noopener noreferrer"
>
Expand All @@ -317,7 +317,7 @@ class GenePage extends React.Component {
<Grid item className={classes.geneInfoItem}>
<a
className={classes.platformLink}
href={`${platformUrl}target/${geneId}`}
href={`${config.platformUrl}target/${geneId}`}
target="_blank"
rel="noopener noreferrer"
>
Expand All @@ -328,7 +328,7 @@ class GenePage extends React.Component {
<Grid item className={classes.geneInfoItem}>
<a
className={classes.platformLink}
href={`${platformUrl}target/${geneId}`}
href={`${config.platformUrl}target/${geneId}`}
target="_blank"
rel="noopener noreferrer"
>
Expand Down