Browse Source

refactor: add staging runtime for app image

develop
Apostolos Fanakis 4 years ago
parent
commit
ba2d6810f0
  1. 25
      docker/concordia-app/Dockerfile

25
docker/concordia-app/Dockerfile

@ -22,22 +22,24 @@ RUN yarn install --frozen-lockfile
COPY ./packages/concordia-contracts ./packages/concordia-contracts COPY ./packages/concordia-contracts ./packages/concordia-contracts
COPY ./packages/concordia-app ./packages/concordia-app COPY ./packages/concordia-app ./packages/concordia-app
# Fix timezome
ARG TZ
ENV TZ=${TZ}
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# -------------------------------------------------- # --------------------------------------------------
# Stage 2 (Test) # Stage 2 (Test)
# -------------------------------------------------- # --------------------------------------------------
FROM base as test FROM base as test
# Fix timezome (needed for timestamps on report files)
ARG TZ
ENV TZ=${TZ}
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
WORKDIR /opt/concordia-app WORKDIR /opt/concordia-app
COPY ./docker/concordia-app/test-app.sh . COPY ./docker/concordia-app/test-app.sh .
WORKDIR /usr/src/concordia/packages/concordia-app WORKDIR /usr/src/concordia/packages/concordia-app
RUN chmod +x /opt/concordia-app/test-app.sh
ENTRYPOINT ["/opt/concordia-app/test-app.sh"] ENTRYPOINT ["/opt/concordia-app/test-app.sh"]
# -------------------------------------------------- # --------------------------------------------------
@ -50,9 +52,18 @@ WORKDIR /usr/src/concordia/packages/concordia-app
RUN yarn build RUN yarn build
# -------------------------------------------------- # --------------------------------------------------
# Stage 4 (Runtime) # Stage 4 (Staging runtime)
# --------------------------------------------------
FROM base as staging
WORKDIR /usr/src/concordia/packages/concordia-app
ENTRYPOINT ["yarn", "start"]
# --------------------------------------------------
# Stage 4 (Production runtime)
# -------------------------------------------------- # --------------------------------------------------
FROM nginx:1.17-alpine as runtime FROM nginx:1.17-alpine as production
LABEL maintainers.1="Apostolos Fanakis <apostolof@auth.gr>" LABEL maintainers.1="Apostolos Fanakis <apostolof@auth.gr>"
LABEL maintainers.2="Panagiotis Nikolaidis <ezerous@gmail.com" LABEL maintainers.2="Panagiotis Nikolaidis <ezerous@gmail.com"
LABEL gr.thmmy.ecentrics.concordia-image.name="app" LABEL gr.thmmy.ecentrics.concordia-image.name="app"

Loading…
Cancel
Save