generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploying to gh-pages-landing from @ f22dde8 🚀
- Loading branch information
1 parent
f00374b
commit aaff032
Showing
46 changed files
with
436 additions
and
380 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 |
---|---|---|
@@ -1,8 +1,33 @@ | ||
**/.git | ||
**/.gitignore | ||
# ignore file extensions | ||
*.DS_Store | ||
*.Rmd | ||
*.html | ||
*.md | ||
*.Rhistory | ||
*.gitignore | ||
*.Rbuildignore | ||
*.Rproj | ||
|
||
# ignore folders | ||
**.git | ||
**.github | ||
**.Rproj.user | ||
*docs | ||
docker.compose.yml | ||
*vignettes | ||
*man | ||
*docker | ||
*inst | ||
*data | ||
*pkgdown | ||
|
||
# ignore specific files | ||
change_log.txt | ||
MIRA-INSTALL.sh | ||
install_docker.sh | ||
docker-compose.yml | ||
docker-compose-*.yml | ||
_pkgdown.yml | ||
MIRA-INSTALL.sh | ||
MIRA.code-workspace | ||
NAMESPACE | ||
|
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
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
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,117 +1,82 @@ | ||
|
||
# Create a build argument | ||
ARG BUILD_STAGE | ||
ARG BUILD_STAGE=${BUILD_STAGE:-prod} | ||
|
||
############# Build Stage: Dependencies ################## | ||
|
||
# Start from a base image | ||
FROM --platform=linux/amd64 ubuntu:focal as base | ||
|
||
# Define a system argument | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install system libraries of general use | ||
RUN apt-get update --allow-releaseinfo-change && apt-get install --no-install-recommends -y \ | ||
build-essential \ | ||
iptables \ | ||
libdevmapper1.02.1 \ | ||
python3.7\ | ||
python3-pip \ | ||
python3-setuptools \ | ||
python3-dev \ | ||
dpkg \ | ||
sudo \ | ||
wget \ | ||
curl \ | ||
dos2unix | ||
|
||
############# Build Stage: Development ################## | ||
|
||
# Build from the base image for dev | ||
FROM base as dev | ||
|
||
# Create working directory variable | ||
ENV WORKDIR=/data | ||
|
||
# Create a stage enviroment | ||
ENV STAGE=dev | ||
|
||
############# Build Stage: Production ################## | ||
|
||
# Build from the base image for prod | ||
FROM base as prod | ||
|
||
# Create working directory variable | ||
ENV WORKDIR=/data | ||
|
||
# Create a stage enviroment | ||
ENV STAGE=prod | ||
|
||
# Copy all scripts to docker images | ||
COPY . /MIRA | ||
|
||
############# Build Stage: Final ################## | ||
|
||
# Build the final image | ||
FROM ${BUILD_STAGE} as final | ||
|
||
# Set up volume directory in docker | ||
VOLUME ${WORKDIR} | ||
|
||
# Set up working directory in docker | ||
WORKDIR ${WORKDIR} | ||
|
||
# Allow permission to read and write files to current working directory | ||
RUN chmod -R a+rwx ${WORKDIR} | ||
|
||
############# Install Docker ################## | ||
|
||
# Copy all files to docker images | ||
COPY docker /MIRA/docker | ||
|
||
# Copy all files to docker images | ||
COPY install_docker.sh /MIRA/install_docker.sh | ||
|
||
# Convert bash script from Windows style line endings to Unix-like control characters | ||
RUN dos2unix /MIRA/install_docker.sh | ||
|
||
# Allow permission to excute the bash script | ||
RUN chmod a+x /MIRA/install_docker.sh | ||
|
||
# Execute bash script to install the package | ||
RUN bash /MIRA/install_docker.sh | ||
|
||
############# Install python packages ################## | ||
|
||
# Copy python requirements file to docker images | ||
COPY requirements.txt /MIRA/requirements.txt | ||
|
||
# Install python requirements | ||
RUN pip3 install --no-cache-dir -r /MIRA/requirements.txt | ||
|
||
############# Launch MIRA dashboard ################## | ||
|
||
# Copy all files to docker images | ||
COPY dashboard-kickoff /MIRA/dashboard-kickoff | ||
|
||
# Convert bash script from Windows style line endings to Unix-like control characters | ||
RUN dos2unix /MIRA/dashboard-kickoff | ||
|
||
# Allow permission to excute the bash scripts | ||
RUN chmod a+x /MIRA/dashboard-kickoff | ||
|
||
# Allow permission to read and write files to MIRA directory | ||
RUN chmod -R a+rwx /MIRA | ||
|
||
# Make the app available at port 8050 | ||
EXPOSE 8050 | ||
|
||
# Clean up | ||
RUN apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* | ||
|
||
# Export bash script to path | ||
ENV PATH "$PATH:/MIRA" | ||
|
||
# Execute the pipeline | ||
ENTRYPOINT ["bash", "dashboard-kickoff"] | ||
# Create an argument to pull a particular version of dias image | ||
ARG spyne_image | ||
ARG spyne_image=${spyne_image:-cdcgov/spyne:latest} | ||
|
||
############# spyne image as base ################## | ||
FROM ${spyne_image} as spyne | ||
RUN echo "Getting spyne image" | ||
|
||
# local apt mirror support | ||
# start every stage with updated apt sources | ||
ARG APT_MIRROR_NAME= | ||
RUN if [ -n "$APT_MIRROR_NAME" ]; then sed -i.bak -E '/security/! s^https?://.+?/(debian|ubuntu)^http://'"$APT_MIRROR_NAME"'/\1^' /etc/apt/sources.list && grep '^deb' /etc/apt/sources.list; fi | ||
|
||
# Install and update system libraries of general use | ||
RUN apt-get update --allow-releaseinfo-change --fix-missing \ | ||
&& apt-get install --no-install-recommends -y \ | ||
build-essential \ | ||
iptables \ | ||
python3.7 \ | ||
python3-pip \ | ||
python3-setuptools \ | ||
dos2unix | ||
|
||
# Create a working directory variable | ||
ENV WORKDIR=/data | ||
|
||
# Set up volume directory | ||
VOLUME ${WORKDIR} | ||
|
||
# Set up working directory | ||
WORKDIR ${WORKDIR} | ||
|
||
# Create a program variable | ||
ENV MIRA_PROGRAM_DIR=/MIRA | ||
|
||
# Set up volume directory | ||
VOLUME ${MIRA_PROGRAM_DIR} | ||
|
||
# Copy all scripts to docker images | ||
COPY . ${MIRA_PROGRAM_DIR} | ||
|
||
############# Install python packages ################## | ||
|
||
# Copy python requirements file to docker images | ||
COPY requirements.txt ${MIRA_PROGRAM_DIR}/requirements.txt | ||
|
||
# Install python requirements | ||
RUN pip3 install --no-cache-dir -r ${MIRA_PROGRAM_DIR}/requirements.txt | ||
|
||
############# Launch MIRA dashboard ################## | ||
|
||
# Copy all files to docker images | ||
COPY dashboard-kickoff ${MIRA_PROGRAM_DIR}/dashboard-kickoff | ||
|
||
# Convert bash script from Windows style line endings to Unix-like control characters | ||
RUN dos2unix ${MIRA_PROGRAM_DIR}/dashboard-kickoff | ||
|
||
# Allow permission to excute the bash scripts | ||
RUN chmod a+x ${MIRA_PROGRAM_DIR}/dashboard-kickoff | ||
|
||
# Allow permission to read and write files to MIRA directory | ||
RUN chmod -R a+rwx ${MIRA_PROGRAM_DIR} | ||
|
||
# Make the app available at port 8050 | ||
EXPOSE 8050 | ||
|
||
# Clean up and remove unwanted files | ||
RUN apt-get autoremove -y \ | ||
&& apt-get clean -y \ | ||
&& rm -rf /var/lib/{apt,dpkg,cache,log}/ | ||
|
||
# Export dais-ribosome script to path | ||
ENV PATH "$PATH:/dais-ribosome" | ||
|
||
# Export irma script to path | ||
ENV PATH "$PATH:/flu-amd" | ||
|
||
# Export spyne script to path | ||
ENV PATH "$PATH:/spyne" | ||
|
||
# Execute the pipeline | ||
ENTRYPOINT ["/bin/bash", "-c", "/MIRA/dashboard-kickoff"] |
Oops, something went wrong.