Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save geoffreysmith/cca049203f6b0a7f5b34372f2451b5f0 to your computer and use it in GitHub Desktop.
Save geoffreysmith/cca049203f6b0a7f5b34372f2451b5f0 to your computer and use it in GitHub Desktop.
# alpine 3.11
FROM node:12-alpine as base
# set working directory
WORKDIR /app
ENV CHROME_BIN /usr/bin/chromium-browser
# Please stop doing things like making us copy things out of separate folders while
# also including a private nuget feed. I'm sure there's a good reason for it, but it is
# like Chinese water torture. <3 you!
COPY package.json speak-ng-bcl-0.8.0.tgz speak-styling-0.9.0-r00078.tgz /app/
RUN echo "npm install running in silent, this may take some time" \
&& npm config set @speak:registry=https://sitecore.myget.org/F/sc-npm-packages/npm/ \
&& npm config set @sitecore:registry=https://sitecore.myget.org/F/sc-npm-packages/npm/ \
&& npm install speak-ng-bcl-0.8.0.tgz -s \
&& npm install speak-styling-0.9.0-r00078.tgz -s \
&& npm install -g @angular/[email protected] -s \
&& npm install @sitecore/bizfx -s \
&& npm install -s
COPY . /app
FROM base as build
RUN ng build -prod
# Cannot get this running on even Windows locally without a browser, let alone headless, runs 0 out of 0 specs
# ignoring this now
FROM build as test
ENV CHROME_BIN /usr/bin/chromium-browser
WORKDIR /app/test
COPY --from=build /app/dist/sdk .
RUN ng test
FROM test as e2e
WORKDIR /app/e2e
COPY /app/dist .
RUN ng e2e
# nginx 1.16.1
# alpine 3.10
FROM nginx:stable-alpine as final
COPY --from=build /app/dist/sdk /app
EXPOSE 80
# run nginx
CMD ["nginx", "-g", "daemon off;"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment