Skip to content

Commit 1095f9a

Browse files
authored
Merge pull request #111 from Integrative-Transcriptomics/update-repo
Updates repo Creates a docker image that has a complete functional version of Evidente.
2 parents d69058f + 0e485d4 commit 1095f9a

File tree

7 files changed

+95
-10
lines changed

7 files changed

+95
-10
lines changed

.babelrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
{
22
"presets": ["es2015", "react"],
3-
"plugins": ["transform-decorators-legacy", "transform-class-properties"]
43
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build and Push Docker Image
2+
3+
# when to run the workflow
4+
on:
5+
push:
6+
branches: [master]
7+
8+
# the jobs to run
9+
jobs:
10+
build:
11+
# the os to run the job on
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
# build the image now
18+
- name: Build Docker image
19+
20+
run: |
21+
docker build -t evidente:latest .
22+
23+
- name: save images
24+
run: |
25+
docker save evidente:latest | gzip > image_evidente.tar.gz
26+
27+
- name: Release WebImage to Repo
28+
uses: svenstaro/upload-release-action@v2
29+
with:
30+
repo_token: ${{ secrets.GITHUB_TOKEN }}
31+
file: image_evidente.tar.gz
32+
asset_name: Evidente
33+
tag: ${{ github.ref }}
34+
overwrite: true
35+
body: "The image for the web app of Evidente"

Dockerfile

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Use an official Node.js runtime as a parent image
2+
# Using a specific version like '20-bullseye-slim' is reliable
3+
FROM node:20-bullseye-slim
4+
5+
# Set the working directory in the container
6+
WORKDIR /app
7+
8+
# Prevent apt-get from asking for user input
9+
ENV DEBIAN_FRONTEND=noninteractive
10+
11+
# Install Python and pip, then clean up
12+
# 1. Update package lists
13+
# 2. Install python3, python3-pip, and a helper to link 'python' to 'python3'
14+
# 3. Clean up apt cache to reduce image size
15+
RUN apt-get update && \
16+
apt-get install -y python3 python3-pip python-is-python3 && \
17+
rm -rf /var/lib/apt/lists/*
18+
19+
# Install git
20+
RUN apt-get update && \
21+
apt-get install -y git && \
22+
rm -rf /var/lib/apt/lists/*
23+
24+
# install java 17
25+
RUN apt-get update && \
26+
apt-get install -y openjdk-17-jre && \
27+
rm -rf /var/lib/apt/lists/*
28+
29+
COPY src src
30+
COPY public public
31+
COPY package.json package.json
32+
COPY server server
33+
COPY requirements.txt requirements.txt
34+
COPY setup.py setup.py
35+
36+
RUN pip install --no-cache-dir -r requirements.txt
37+
RUN pip install --no-cache-dir .
38+
RUN npm install
39+
RUN npm run build
40+
41+
# expose the port the app runs on
42+
EXPOSE 3000
43+
44+
45+
# Define the command to run the app
46+
CMD ["gunicorn", "--bind", "0.0.0.0:3000", "server.wsgi:app"]

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
"@testing-library/jest-dom": "^4.2.4",
1010
"@testing-library/react": "^9.5.0",
1111
"@testing-library/user-event": "^7.2.1",
12-
"popper.js": "^1.16.1",
1312
"array-move": "^2.2.1",
1413
"bootstrap": "^4.5.0",
1514
"browserify": "^17.0.0",
@@ -20,16 +19,17 @@
2019
"evergreen-ui": "^2.0.1",
2120
"html2canvas": "^1.3.2",
2221
"jquery": "^3.5.1",
23-
"lodash": "^4.17.21",
2422
"jspdf": "^2.3.1",
25-
"phylotree": "github:mwittep/phylotree.js",
23+
"lodash": "^4.17.21",
24+
"phylotree": "github:Integrative-Transcriptomics/phylotree.js",
25+
"popper.js": "^1.16.1",
2626
"react": "^16.13.1",
2727
"react-bootstrap": "^1.0.1",
2828
"react-color": "^2.18.1",
2929
"react-dom": "^16.13.1",
3030
"react-draggable": "^4.4.3",
3131
"react-loading-overlay": "^1.0.1",
32-
"react-scripts": "^4.*.*",
32+
"react-scripts": "^5.0.1",
3333
"react-select": "^2.4.4",
3434
"react-sortable-hoc": "^1.11.0",
3535
"react-virtualized": "^9.21.2",
@@ -38,8 +38,8 @@
3838
"scripts": {
3939
"server": "cd server && flask run --no-debugger",
4040
"evidente": "run-p server start",
41-
"start": "react-scripts start",
42-
"build": "react-scripts build",
41+
"start": "react-scripts --openssl-legacy-provider start",
42+
"build": "react-scripts --openssl-legacy-provider build",
4343
"test": "react-scripts test",
4444
"eject": "react-scripts eject"
4545
},

requirements.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ charset-normalizer==2.0.8
44
click==8.0.3
55
docopt==0.6.2
66
Flask==2.0.2
7-
goatools==1.1.6
7+
goatools==1.4.12
88
idna==3.3
99
importlib-metadata==4.8.2
1010
itsdangerous==2.0.1
1111
Jinja2==3.0.3
1212
MarkupSafe==2.0.1
13-
numpy==1.21.4
13+
numpy==1.22.0
1414
ordered-set==4.0.2
1515
packaging==21.3
1616
pandas==1.3.4
@@ -32,3 +32,4 @@ wget==3.2
3232
xlrd==1.2.0
3333
XlsxWriter==3.0.2
3434
zipp==3.6.0
35+
gunicorn==23.0.0

server/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,4 +238,4 @@ def index():
238238
if __name__ == "__main__":
239239
mp.set_start_method('spawn')
240240

241-
app.run(debug=True, port=int("3001"))
241+
app.run(port=int("3001"))

server/wsgi.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from server import app
2+
3+
if __name__ == "__main__":
4+
app.run()

0 commit comments

Comments
 (0)