-
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.
build: add dev Dockerfile and update CD action
- Loading branch information
1 parent
886e2f4
commit 127593b
Showing
4 changed files
with
194 additions
and
13 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
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,102 @@ | ||
# create-react-app build environment | ||
FROM node:20-alpine as react-build | ||
WORKDIR /app | ||
ENV PATH /app/node_modules/.bin:$PATH | ||
|
||
COPY package*.json yarn.lock ./ | ||
RUN --mount=type=cache,target=/root/.yarn \ | ||
YARN_CACHE_FOLDER=/root/.yarn JOBS=max \ | ||
yarn install --network-timeout 1000000 | ||
|
||
COPY src ./src | ||
COPY public ./public | ||
RUN --mount=type=cache,target=/root/.yarn \ | ||
YARN_CACHE_FOLDER=/root/.yarn JOBS=max \ | ||
yarn sass | ||
|
||
ARG REACT_APP_ES_PROXY_HOST | ||
ARG REACT_APP_ES_PROXY_HOST_DEV | ||
ARG REACT_APP_API_SERVICE_ADDRESS | ||
ARG REACT_APP_API_SERVICE_ADDRESS_DEV | ||
ARG REACT_APP_API_SERVICE_KEY | ||
ARG REACT_APP_API_SERVICE_KEY_DEV | ||
ARG REACT_APP_SIGNED_URL_ENDPOINT | ||
ARG REACT_APP_USER_REGISTRATION_ENDPOINT | ||
ARG REACT_APP_SEND_EMAIL_ENDPOINT | ||
ARG REACT_APP_FILE_DOWNLOAD_ENDPOINT | ||
ARG REACT_APP_QC_DATA_ENDPOINT | ||
ARG REACT_APP_ES_ENDPOINT | ||
ARG REACT_APP_FILE_SEARCH_ENDPOINT | ||
ARG REACT_APP_DATA_FILE_BUCKET | ||
ARG REACT_APP_QC_REPORT_BUCKET | ||
ARG REACT_APP_QC_REPORT_BUCKET_DEV | ||
ARG REACT_APP_ES_ACCESS_TOKEN | ||
ARG REACT_APP_ES_ACCESS_TOKEN_DEV | ||
ARG REACT_APP_reCAPTCHA_SITE_KEY | ||
ARG REACT_APP_AUTH0_CLIENT_ID | ||
ARG REACT_APP_QUALTRICS_SURVEY_URL | ||
ARG REACT_APP_USER_SURVEY_SUBMIT_URL | ||
ARG REACT_APP_USER_SURVEY_INPUT_1 | ||
ARG REACT_APP_USER_SURVEY_INPUT_2 | ||
ARG REACT_APP_USER_SURVEY_INPUT_3 | ||
ARG REACT_APP_USER_SURVEY_INPUT_4 | ||
ARG REACT_APP_USER_SURVEY_INPUT_5 | ||
ARG REACT_APP_OFFICE_HOUR_DAY | ||
ARG REACT_APP_OFFICE_HOUR_DATE | ||
ARG REACT_APP_OFFICE_HOUR_SIGNUP_URL | ||
|
||
ENV ESLINT_NO_DEV_ERRORS true | ||
ENV DISABLE_ESLINT_PLUGIN true | ||
ENV REACT_APP_ES_PROXY_HOST $REACT_APP_ES_PROXY_HOST | ||
ENV REACT_APP_ES_PROXY_HOST_DEV $REACT_APP_ES_PROXY_HOST_DEV | ||
ENV REACT_APP_API_SERVICE_ADDRESS $REACT_APP_API_SERVICE_ADDRESS | ||
ENV REACT_APP_API_SERVICE_ADDRESS_DEV $REACT_APP_API_SERVICE_ADDRESS_DEV | ||
ENV REACT_APP_API_SERVICE_KEY $REACT_APP_API_SERVICE_KEY | ||
ENV REACT_APP_API_SERVICE_KEY_DEV $REACT_APP_API_SERVICE_KEY_DEV | ||
ENV REACT_APP_SIGNED_URL_ENDPOINT $REACT_APP_SIGNED_URL_ENDPOINT | ||
ENV REACT_APP_USER_REGISTRATION_ENDPOINT $REACT_APP_USER_REGISTRATION_ENDPOINT | ||
ENV REACT_APP_SEND_EMAIL_ENDPOINT $REACT_APP_SEND_EMAIL_ENDPOINT | ||
ENV REACT_APP_FILE_DOWNLOAD_ENDPOINT $REACT_APP_FILE_DOWNLOAD_ENDPOINT | ||
ENV REACT_APP_QC_DATA_ENDPOINT $REACT_APP_QC_DATA_ENDPOINT | ||
ENV REACT_APP_ES_ENDPOINT $REACT_APP_ES_ENDPOINT | ||
ENV REACT_APP_FILE_SEARCH_ENDPOINT $REACT_APP_FILE_SEARCH_ENDPOINT | ||
ENV REACT_APP_DATA_FILE_BUCKET $REACT_APP_DATA_FILE_BUCKET | ||
ENV REACT_APP_QC_REPORT_BUCKET $REACT_APP_QC_REPORT_BUCKET | ||
ENV REACT_APP_QC_REPORT_BUCKET_DEV $REACT_APP_QC_REPORT_BUCKET_DEV | ||
ENV REACT_APP_ES_ACCESS_TOKEN $REACT_APP_ES_ACCESS_TOKEN | ||
ENV REACT_APP_ES_ACCESS_TOKEN_DEV $REACT_APP_ES_ACCESS_TOKEN_DEV | ||
ENV REACT_APP_reCAPTCHA_SITE_KEY $REACT_APP_reCAPTCHA_SITE_KEY | ||
ENV REACT_APP_AUTH0_CLIENT_ID $REACT_APP_AUTH0_CLIENT_ID | ||
ENV REACT_APP_QUALTRICS_SURVEY_URL $REACT_APP_QUALTRICS_SURVEY_URL | ||
ENV REACT_APP_USER_SURVEY_SUBMIT_URL $REACT_APP_USER_SURVEY_SUBMIT_URL | ||
ENV REACT_APP_USER_SURVEY_INPUT_1 $REACT_APP_USER_SURVEY_INPUT_1 | ||
ENV REACT_APP_USER_SURVEY_INPUT_2 $REACT_APP_USER_SURVEY_INPUT_2 | ||
ENV REACT_APP_USER_SURVEY_INPUT_3 $REACT_APP_USER_SURVEY_INPUT_3 | ||
ENV REACT_APP_USER_SURVEY_INPUT_4 $REACT_APP_USER_SURVEY_INPUT_4 | ||
ENV REACT_APP_USER_SURVEY_INPUT_5 $REACT_APP_USER_SURVEY_INPUT_5 | ||
ENV REACT_APP_OFFICE_HOUR_DAY $REACT_APP_OFFICE_HOUR_DAY | ||
ENV REACT_APP_OFFICE_HOUR_DATE $REACT_APP_OFFICE_HOUR_DATE | ||
ENV REACT_APP_OFFICE_HOUR_SIGNUP_URL $REACT_APP_OFFICE_HOUR_SIGNUP_URL | ||
ENV NODE_ENV development | ||
|
||
RUN --mount=type=cache,target=/root/.yarn \ | ||
YARN_CACHE_FOLDER=/root/.yarn JOBS=max \ | ||
yarn build | ||
|
||
# nginx server environment | ||
FROM nginxinc/nginx-unprivileged:1.25-alpine | ||
|
||
COPY nginx.conf /etc/nginx/conf.d/default.conf | ||
COPY --from=react-build /app/build /usr/share/nginx/html | ||
|
||
LABEL org.opencontainers.image.description="MoTrPAC Data Portal Docker Image" | ||
LABEL org.opencontainers.image.documentation="https://github.com/MoTrPAC/motrpac-frontend" | ||
LABEL org.opencontainers.image.title="MoTrPAC Data Portal Web Client Server" | ||
LABEL org.opencontainers.image.url="https://motrpac-data.org" | ||
LABEL org.opencontainers.image.vendor="MoTrPAC" | ||
LABEL org.opencontainers.image.version=$IMAGE_VERSION | ||
|
||
ENV NODE_ENV dev | ||
|
||
EXPOSE 8080 | ||
|
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,42 @@ | ||
services: | ||
web: | ||
platform: linux/amd64 | ||
image: motrpac-frontend:latest | ||
ports: | ||
- 34928:8080 | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.dev | ||
args: | ||
ESLINT_NO_DEV_ERRORS: true | ||
DISABLE_ESLINT_PLUGIN: true | ||
REACT_APP_ES_PROXY_HOST: ${REACT_APP_ES_PROXY_HOST} | ||
REACT_APP_ES_PROXY_HOST_DEV: ${REACT_APP_ES_PROXY_HOST_DEV} | ||
REACT_APP_API_SERVICE_ADDRESS: ${REACT_APP_API_SERVICE_ADDRESS} | ||
REACT_APP_API_SERVICE_ADDRESS_DEV: ${REACT_APP_API_SERVICE_ADDRESS_DEV} | ||
REACT_APP_API_SERVICE_KEY: ${REACT_APP_API_SERVICE_KEY} | ||
REACT_APP_API_SERVICE_KEY_DEV: ${REACT_APP_API_SERVICE_KEY_DEV} | ||
REACT_APP_SIGNED_URL_ENDPOINT: ${REACT_APP_SIGNED_URL_ENDPOINT} | ||
REACT_APP_USER_REGISTRATION_ENDPOINT: ${REACT_APP_USER_REGISTRATION_ENDPOINT} | ||
REACT_APP_SEND_EMAIL_ENDPOINT: ${REACT_APP_SEND_EMAIL_ENDPOINT} | ||
REACT_APP_FILE_DOWNLOAD_ENDPOINT: ${REACT_APP_FILE_DOWNLOAD_ENDPOINT} | ||
REACT_APP_QC_DATA_ENDPOINT: ${REACT_APP_QC_DATA_ENDPOINT} | ||
REACT_APP_ES_ENDPOINT: ${REACT_APP_ES_ENDPOINT} | ||
REACT_APP_FILE_SEARCH_ENDPOINT: ${REACT_APP_FILE_SEARCH_ENDPOINT} | ||
REACT_APP_DATA_FILE_BUCKET: ${REACT_APP_DATA_FILE_BUCKET} | ||
REACT_APP_QC_REPORT_BUCKET: ${REACT_APP_QC_REPORT_BUCKET} | ||
REACT_APP_QC_REPORT_BUCKET_DEV: ${REACT_APP_QC_REPORT_BUCKET_DEV} | ||
REACT_APP_ES_ACCESS_TOKEN: ${REACT_APP_ES_ACCESS_TOKEN} | ||
REACT_APP_ES_ACCESS_TOKEN_DEV: ${REACT_APP_ES_ACCESS_TOKEN_DEV} | ||
REACT_APP_reCAPTCHA_SITE_KEY: ${REACT_APP_reCAPTCHA_SITE_KEY} | ||
REACT_APP_AUTH0_CLIENT_ID: ${REACT_APP_AUTH0_CLIENT_ID} | ||
REACT_APP_QUALTRICS_SURVEY_URL: ${REACT_APP_QUALTRICS_SURVEY_URL} | ||
REACT_APP_USER_SURVEY_SUBMIT_URL: ${REACT_APP_USER_SURVEY_SUBMIT_URL} | ||
REACT_APP_USER_SURVEY_INPUT_1: ${REACT_APP_USER_SURVEY_INPUT_1} | ||
REACT_APP_USER_SURVEY_INPUT_2: ${REACT_APP_USER_SURVEY_INPUT_2} | ||
REACT_APP_USER_SURVEY_INPUT_3: ${REACT_APP_USER_SURVEY_INPUT_3} | ||
REACT_APP_USER_SURVEY_INPUT_4: ${REACT_APP_USER_SURVEY_INPUT_4} | ||
REACT_APP_USER_SURVEY_INPUT_5: ${REACT_APP_USER_SURVEY_INPUT_5} | ||
REACT_APP_OFFICE_HOUR_DAY: ${REACT_APP_OFFICE_HOUR_DAY} | ||
REACT_APP_OFFICE_HOUR_DATE: ${REACT_APP_OFFICE_HOUR_DATE} | ||
REACT_APP_OFFICE_HOUR_SIGNUP_URL: ${REACT_APP_OFFICE_HOUR_SIGNUP_URL} |
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