vega-frontend-monorepo/Dockerfile.cra
Dexter Edwards 05d8cb3605
Feat: Containerised docker images (#700)
* chore: first pass at config file

* ci: pass app version

* ci: remove workflows that take a while to run to not waste build mins

* ci: run all steps all the time

* ci: correct tags

* ci: correct output syntax

* ci: use quotes

* ci: fix build platform

* ci: only build amd as PoC

* ci: add push true to step

* ci: publish trading and token containers

* fix: use correct environement variable names

* feat: separate dockerfiles for CRA based apps and next apps

* chore: correct path

* fix: incorrect asset path

* ci: build for both platforms

* ci: publish

* ci: add missing deps

* ci: rename pipelines

* ci: rename

* ci: publish on tag only

* ci: remove additional vs

* Revert "ci: remove workflows that take a while to run to not waste build mins"

This reverts commit 7054367ba0.

* chore: remove comment

* chore: revert accientally committed change
2022-07-25 09:48:29 +01:00

31 lines
676 B
Docker

# Build container
FROM node:16.14.0-alpine as build
WORKDIR /app
# Argument to allow building of different apps
ARG APP
ENV PATH /app/node_modules/.bin:$PATH
COPY package.json ./
COPY yarn.lock ./
COPY . ./
RUN apk add python3 make gcc g++
RUN yarn
RUN yarn nx build $APP
# Production environment
FROM nginx:stable-alpine
ARG APP
COPY --from=build /app/dist/apps/$APP /usr/share/nginx/html
COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
WORKDIR /usr/share/nginx/html
COPY ./env.sh .
COPY ./apps/$APP/.env .env
# Add bash
RUN apk add --no-cache bash
RUN chmod +x ./env.sh
CMD ["/bin/bash", "-c", "/usr/share/nginx/html/env.sh && nginx -g \"daemon off;\""]