ghost-portal/docker/Dockerfile
Jaco a0e84550fc
User Node 14.x for docker base (#5480)
* User Node 14.x for docker base

* Move docker scripts

* Adjust paths

* Clean apt cache

* semgrep recommendations

* No recommends

* Additional clean
2021-06-07 15:06:43 +02:00

37 lines
904 B
Docker

FROM ubuntu:18.04 as builder
# Install any needed packages
RUN apt-get update && \
apt-get install --no-install-recommends -y curl git gnupg && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# install nodejs
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get install --no-install-recommends -y nodejs
WORKDIR /apps
COPY . .
RUN npm install yarn -g
RUN yarn && NODE_ENV=production yarn build:www
# ===========================================================
FROM nginx:stable-alpine
# The following is mainly for doc purpose to show which ENV is supported
ENV WS_URL=
WORKDIR /usr/share/nginx/html
COPY env.sh .
RUN apk add --no-cache bash; chmod +x env.sh
COPY docker/nginx.conf /etc/nginx/nginx.conf
COPY --from=builder /apps/packages/apps/build /usr/share/nginx/html
EXPOSE 80
CMD ["/bin/bash", "-c", "/usr/share/nginx/html/env.sh && nginx -g \"daemon off;\""]