Skip to content

Commit 087934b

Browse files
committed
Added Dockerfiles for Murfey services to repo, and add build context for Murfey frontend
1 parent e35c6fe commit 087934b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+22821
-0
lines changed

Dockerfiles/murfey-frontend

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Build commmand template:
2+
# podman build --build-arg API_ENDPOINT=<api_endpoint> ... --no-cache -t murfey-frontend:<version> -f /path/to/Dockerfiles/murfey-frontend path/to/murfey-frontend
3+
4+
FROM docker.io/library/node:22.13.0-alpine3.20 as build
5+
# FROM docker.io/library/node:20.11.0-alpine3.19 as build
6+
7+
# Set arguments and environment variables
8+
ARG DEPLOY_TYPE="production"
9+
ARG API_ENDPOINT="http://localhost:8000/"
10+
ARG DEV_CONTACT="[email protected]"
11+
ARG VERSION=0.0.1
12+
ARG FEEDBACK_URL="http://localhost:8080/"
13+
14+
ENV REACT_APP_DEPLOY_TYPE=${DEPLOY_TYPE}
15+
ENV REACT_APP_HUB_ENDPOINT=${API_ENDPOINT}
16+
ENV REACT_APP_VERSION=${VERSION}
17+
ENV REACT_APP_DEV_CONTACT=${DEV_CONTACT}
18+
ENV REACT_APP_AUTH_TYPE="oidc"
19+
ENV REACT_APP_FEEDBACK_URL=${FEEDBACK_URL}
20+
21+
# Set working directory to build installation in
22+
WORKDIR /usr/src/app
23+
24+
# Install all Yarn dependencies listed in package.json using versions listed in
25+
# .lock file as unless they are not sufficient to satisfy package requirements
26+
COPY ./package.json ./yarn.lock ./
27+
RUN yarn install --immutable --check-cache
28+
29+
# Copy across files needed to build the app and build it
30+
COPY ./ ./
31+
RUN yarn build
32+
33+
# Start second stage of build(?)
34+
FROM docker.io/nginxinc/nginx-unprivileged:alpine3.20-slim
35+
# FROM docker.io/nginxinc/nginx-unprivileged:alpine3.18-slim
36+
COPY --from=build --chown=nginx /usr/src/app/build /usr/share/nginx/html
37+
COPY --chown=nginx nginx/conf.d /tmp/nginx/nginx.conf
38+
COPY --chown=nginx mime.types /tmp/nginx/mime.types
39+
40+
EXPOSE 8080
41+
CMD [ \
42+
"nginx", \
43+
"-c", \
44+
"/tmp/nginx/nginx.conf", \
45+
"-g", \
46+
"daemon off;" \
47+
]
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Build command template
2+
# podman build --build-arg groupid=<groupid> --build-arg userid=<userid> --build-arg groupname=<groupname> --no-cache -f path/to/Dockerfiles/murfey-instrument-server -t murfey-instrument-server:<version> path/to/python-murfey
3+
4+
# Set up the Python base image to build with
5+
FROM docker.io/library/python:3.12.8-slim-bullseye as build
6+
7+
# Define external build arguments
8+
ARG groupid
9+
ARG groupname
10+
ARG userid
11+
12+
# Add system dependencies for the developer/build environment
13+
# Add the group and user ID to be used by Murfey
14+
RUN apt-get update && \
15+
apt-get upgrade -y && \
16+
apt-get install -y --no-install-recommends \
17+
build-essential \
18+
busybox \
19+
git \
20+
net-tools \
21+
libpq-dev && \
22+
busybox --install &&\
23+
rm -rf /var/lib/apt/lists/* && \
24+
groupadd -r -g "${groupid}" "${groupname}" && useradd -r -M "${groupname}" -u "${userid}" -g "${groupname}"
25+
26+
# Copy essential Murfey source files across from repo
27+
COPY --chown="${userid}":"${groupid}" src/murfey/ /repos/python-murfey/src/murfey/
28+
COPY --chown="${userid}":"${groupid}" \
29+
pyproject.toml \
30+
setup.py \
31+
api-spec.yaml \
32+
AUTHORS.rst \
33+
catalog-info.yaml \
34+
LICENSE \
35+
MANIFEST.in \
36+
README.md \
37+
/repos/python-murfey/
38+
39+
# Set the repo as the current working directory
40+
WORKDIR /repos/python-murfey
41+
42+
# Set up a virtual environment and install Murfey
43+
RUN python -m venv /venv && \
44+
chmod -R a+x /venv && \
45+
/venv/bin/python -m pip install --upgrade \
46+
pip \
47+
build \
48+
importlib-metadata &&\
49+
/venv/bin/python -m pip install .[client,instrument-server]
50+
51+
# Prepend the virtual environment to PATH
52+
ENV PATH=/venv/bin:$PATH

Dockerfiles/murfey-rsync

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Template build command
2+
# podman build --build-arg groupid=<groupid> --build-arg userid=<userid> --build-arg groupname=<groupname> --no-cache -f path/to/Dockerfiles/murfey-rsync
3+
4+
FROM docker.io/library/alpine:3.20
5+
# FROM alpine:3.14
6+
7+
ARG groupid
8+
ARG groupname
9+
ARG userid
10+
11+
# Add any system dependencies for the developer/build environment here
12+
RUN apk add --no-cache rsync
13+
14+
RUN addgroup -S -g "${groupid}" "${groupname}" && adduser -S "${groupname}" -G "${groupname}" -u "${userid}" -s /bin/sh

Dockerfiles/murfey-server

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Template build command
2+
# podman build --build-arg groupid=<groupid> --build-arg userid=<userid> --build-arg groupname=<groupname> --no-cache -f path/to/Dockerfiles/murfey-server -t murfey-server:<version> path/to/python-murfey
3+
4+
# Set up the Python base image to build with
5+
FROM docker.io/library/python:3.12.8-slim-bullseye as build
6+
7+
# Define external build arguments
8+
ARG groupid
9+
ARG groupname
10+
ARG userid
11+
12+
# Add system dependencies for the developer/build environment
13+
# Add the group and user ID to be used by Murfey
14+
RUN apt-get update && \
15+
apt-get upgrade -y && \
16+
apt-get install -y --no-install-recommends \
17+
build-essential \
18+
busybox \
19+
git \
20+
net-tools \
21+
libpq-dev && \
22+
busybox --install &&\
23+
rm -rf /var/lib/apt/lists/* && \
24+
groupadd -r -g "${groupid}" "${groupname}" && useradd -r -M "${groupname}" -u "${userid}" -g "${groupname}"
25+
26+
# Copy essential Murfey source files across from repo
27+
COPY --chown="${userid}":"${groupid}" src/murfey/ /repos/python-murfey/src/murfey/
28+
COPY --chown="${userid}":"${groupid}" \
29+
pyproject.toml \
30+
setup.py \
31+
api-spec.yaml \
32+
AUTHORS.rst \
33+
catalog-info.yaml \
34+
LICENSE \
35+
MANIFEST.in \
36+
README.md \
37+
/repos/python-murfey/
38+
39+
# Set the repo as the current working directory
40+
WORKDIR /repos/python-murfey
41+
42+
# Set up a virtual environment and install Murfey
43+
RUN python -m venv /venv && \
44+
chmod -R a+x /venv && \
45+
/venv/bin/python -m pip install --upgrade \
46+
pip \
47+
build \
48+
importlib-metadata \
49+
psycopg2-binary && \
50+
/venv/bin/python -m pip install .[server]
51+
52+
# Prepend the virtual environment to PATH
53+
ENV PATH=/venv/bin:$PATH

murfey-frontend/README.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Getting Started with Create React App
2+
3+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4+
5+
## Available Scripts
6+
7+
In the project directory, you can run:
8+
9+
### `yarn start`
10+
11+
Runs the app in the development mode.\
12+
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
13+
14+
The page will reload when you make changes.\
15+
You may also see any lint errors in the console.
16+
17+
### `yarn test`
18+
19+
Launches the test runner in the interactive watch mode.\
20+
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21+
22+
### `yarn build`
23+
24+
Builds the app for production to the `build` folder.\
25+
It correctly bundles React in production mode and optimizes the build for the best performance.
26+
27+
The build is minified and the filenames include the hashes.\
28+
Your app is ready to be deployed!
29+
30+
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31+
32+
### `yarn eject`
33+
34+
**Note: this is a one-way operation. Once you `eject`, you can't go back!**
35+
36+
If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37+
38+
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
39+
40+
You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
41+
42+
## Learn More
43+
44+
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45+
46+
To learn React, check out the [React documentation](https://reactjs.org/).
47+
48+
### Code Splitting
49+
50+
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
51+
52+
### Analyzing the Bundle Size
53+
54+
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
55+
56+
### Making a Progressive Web App
57+
58+
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
59+
60+
### Advanced Configuration
61+
62+
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
63+
64+
### Deployment
65+
66+
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
67+
68+
### `yarn build` fails to minify
69+
70+
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)

murfey-frontend/mime.types

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
types {
2+
text/html html htm shtml;
3+
text/css css;
4+
text/xml xml;
5+
image/gif gif;
6+
image/jpeg jpeg jpg;
7+
application/javascript js;
8+
application/atom+xml atom;
9+
application/rss+xml rss;
10+
11+
text/mathml mml;
12+
text/plain txt;
13+
text/vnd.sun.j2me.app-descriptor jad;
14+
text/vnd.wap.wml wml;
15+
text/x-component htc;
16+
17+
image/avif avif;
18+
image/png png;
19+
image/svg+xml svg svgz;
20+
image/tiff tif tiff;
21+
image/vnd.wap.wbmp wbmp;
22+
image/webp webp;
23+
image/x-icon ico;
24+
image/x-jng jng;
25+
image/x-ms-bmp bmp;
26+
27+
font/woff woff;
28+
font/woff2 woff2;
29+
30+
application/java-archive jar war ear;
31+
application/json json;
32+
application/mac-binhex40 hqx;
33+
application/msword doc;
34+
application/pdf pdf;
35+
application/postscript ps eps ai;
36+
application/rtf rtf;
37+
application/vnd.apple.mpegurl m3u8;
38+
application/vnd.google-earth.kml+xml kml;
39+
application/vnd.google-earth.kmz kmz;
40+
application/vnd.ms-excel xls;
41+
application/vnd.ms-fontobject eot;
42+
application/vnd.ms-powerpoint ppt;
43+
application/vnd.oasis.opendocument.graphics odg;
44+
application/vnd.oasis.opendocument.presentation odp;
45+
application/vnd.oasis.opendocument.spreadsheet ods;
46+
application/vnd.oasis.opendocument.text odt;
47+
application/vnd.openxmlformats-officedocument.presentationml.presentation
48+
pptx;
49+
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
50+
xlsx;
51+
application/vnd.openxmlformats-officedocument.wordprocessingml.document
52+
docx;
53+
application/vnd.wap.wmlc wmlc;
54+
application/wasm wasm;
55+
application/x-7z-compressed 7z;
56+
application/x-cocoa cco;
57+
application/x-java-archive-diff jardiff;
58+
application/x-java-jnlp-file jnlp;
59+
application/x-makeself run;
60+
application/x-perl pl pm;
61+
application/x-pilot prc pdb;
62+
application/x-rar-compressed rar;
63+
application/x-redhat-package-manager rpm;
64+
application/x-sea sea;
65+
application/x-shockwave-flash swf;
66+
application/x-stuffit sit;
67+
application/x-tcl tcl tk;
68+
application/x-x509-ca-cert der pem crt;
69+
application/x-xpinstall xpi;
70+
application/xhtml+xml xhtml;
71+
application/xspf+xml xspf;
72+
application/zip zip;
73+
74+
application/octet-stream bin exe dll;
75+
application/octet-stream deb;
76+
application/octet-stream dmg;
77+
application/octet-stream iso img;
78+
application/octet-stream msi msp msm;
79+
80+
audio/midi mid midi kar;
81+
audio/mpeg mp3;
82+
audio/ogg ogg;
83+
audio/x-m4a m4a;
84+
audio/x-realaudio ra;
85+
86+
video/3gpp 3gpp 3gp;
87+
video/mp2t ts;
88+
video/mp4 mp4;
89+
video/mpeg mpeg mpg;
90+
video/quicktime mov;
91+
video/webm webm;
92+
video/x-flv flv;
93+
video/x-m4v m4v;
94+
video/x-mng mng;
95+
video/x-ms-asf asx asf;
96+
video/x-ms-wmv wmv;
97+
video/x-msvideo avi;
98+
}
99+

murfey-frontend/nginx/conf.d

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
worker_processes 3;
2+
pid /tmp/nginx.pid; # Changed from /var/run/nginx.pid
3+
error_log /var/log/nginx/error.log;
4+
events {
5+
worker_connections 10240;
6+
}
7+
8+
http {
9+
include mime.types;
10+
client_body_temp_path /tmp/client_temp;
11+
proxy_temp_path /tmp/proxy_temp_path;
12+
fastcgi_temp_path /tmp/fastcgi_temp;
13+
uwsgi_temp_path /tmp/uwsgi_temp;
14+
scgi_temp_path /tmp/scgi_temp;
15+
server {
16+
listen 8080;
17+
location / {
18+
root /usr/share/nginx/html;
19+
index index.html index.htm;
20+
try_files $uri $uri/ /index.html;
21+
}
22+
error_page 500 502 503 504 /50x.html;
23+
location = /50x.html {
24+
root /usr/share/nginx/html;
25+
}
26+
}
27+
}
28+

0 commit comments

Comments
 (0)