2023-03-20 12:55:39 +00:00
|
|
|
FROM node:18.15.0-alpine3.16
|
|
|
|
|
2023-04-18 12:55:58 +00:00
|
|
|
# This container pulls npm package from a registry configured via env var
|
|
|
|
ARG CERC_NPM_REGISTRY_URL
|
2023-03-20 12:55:39 +00:00
|
|
|
|
2023-04-18 12:55:58 +00:00
|
|
|
RUN apk --update --no-cache add make git python3 jq bash
|
2023-03-20 12:55:39 +00:00
|
|
|
|
2023-04-18 12:55:58 +00:00
|
|
|
# We do this to get a yq binary from the published container, for the correct architecture we're building here
|
|
|
|
COPY --from=docker.io/mikefarah/yq:latest /usr/bin/yq /usr/local/bin/yq
|
2023-03-20 12:55:39 +00:00
|
|
|
|
2023-04-18 12:55:58 +00:00
|
|
|
RUN mkdir -p /scripts
|
|
|
|
COPY ./apply-webapp-config.sh /scripts
|
|
|
|
COPY ./start-serving-app.sh /scripts
|
2023-03-24 11:53:54 +00:00
|
|
|
|
2023-04-18 12:55:58 +00:00
|
|
|
# Configure the local npm registry
|
|
|
|
RUN npm config set @cerc-io:registry ${CERC_NPM_REGISTRY_URL}
|
2023-03-20 12:55:39 +00:00
|
|
|
|
2023-04-18 12:55:58 +00:00
|
|
|
RUN mkdir -p /config
|
|
|
|
|
|
|
|
# Install simple web server for now (use nginx perhaps later)
|
|
|
|
RUN yarn global add http-server
|
|
|
|
|
|
|
|
# Globally install the payload web app package
|
2023-05-04 13:12:45 +00:00
|
|
|
RUN yarn global add @cerc-io/test-app@0.2.34
|
2023-04-18 12:55:58 +00:00
|
|
|
|
|
|
|
# Expose port for http
|
|
|
|
EXPOSE 80
|
|
|
|
|
|
|
|
CMD ["/scripts/start-serving-app.sh"]
|