ghost-portal/Dockerfile
Chevdor 19f409023c
Add ENV support to the generated site (#2450)
* WIP Add ENV support to the generated site

* At that point, the ENV make it as JS script inside the container but are not picked up yet

* Fix code to fetch WS_URL from our imported ENV

* Cleanup

* Fix Dockerfile and add doc

* Cleanup of the shell script
2020-04-25 08:29:59 +02:00

35 lines
823 B
Docker

FROM ubuntu:18.04 as builder
# Install any needed packages
RUN apt-get update && apt-get install -y curl git gnupg
# install nodejs
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get install -y nodejs
WORKDIR /apps
COPY . .
RUN npm install yarn -g
RUN yarn && NODE_ENV=production yarn build:www
CMD ["ls", "-al", "build"]
# ===========================================================
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;\""]