-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from gt-sse-center/kate/docker_file
working dockerfile and working cypress test run on push
- Loading branch information
Showing
5 changed files
with
1,442 additions
and
3,179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.git | ||
Dockerfile* | ||
react_frontend/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Commit Workflow | ||
on: | ||
push | ||
jobs: | ||
run-cypress-tests: | ||
runs-on: ubuntu-latest | ||
name: Run Cypress Tests | ||
container: | ||
image: cypress/browsers:node18.12.0-chrome107 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Run Cypress | ||
uses: cypress-io/github-action@v6 | ||
with: | ||
working-directory: ./react-frontend | ||
build: npm run build | ||
start: npm start | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# syntax=docker/dockerfile:1 | ||
# This docker container runs the web portal | ||
# Slim Linux image | ||
FROM alpine:latest | ||
LABEL description="Ramanujan Machine Web Portal" | ||
|
||
# set working directory | ||
WORKDIR /srv/ramanujan-machine-portal | ||
|
||
# install node | ||
RUN apk update && apk add nodejs npm | ||
|
||
COPY ./react-frontend/package.json ./ | ||
COPY ./react-frontend/package-lock.json ./ | ||
COPY ./react-frontend/tsconfig.json ./ | ||
|
||
# install node package dependencies | ||
RUN npm ci | ||
|
||
# Copy project files | ||
COPY ./react-frontend/src ./src | ||
COPY ./react-frontend/public ./public | ||
|
||
# Build project | ||
RUN npm run build | ||
|
||
# remove dev dependencies | ||
RUN npm prune --production | ||
# RUN npm install -g serve | ||
|
||
EXPOSE 3000 | ||
#ENTRYPOINT ["serve", "-s", "build"] | ||
ENTRYPOINT ["npm", "run", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
# ramanujan-machine-web | ||
# Ramanujan Machine Web Portal | ||
|
||
## Run with Docker | ||
To run the web portal using the Dockerfile: | ||
|
||
`docker build . -t ramanujan-machine-web-portal:latest` | ||
|
||
`docker run -p 8080:3000 ramanujan-machine-web-portal:latest` | ||
|
||
Note that the first port is the port you can access via your web browser, e.g. `http://localhost:8080` is where you would be able to interact with the app given the above configuration. You can change `8080` to whatever port you wish, but the application runs on port `3000` inside the container. | ||
|
||
## Run with Docker | ||
Refer to [React Frontend README](./react-frontend/README.md) to run locally. |
Oops, something went wrong.