Using multistage builds with protocol buffers
This commit is contained in:
parent
d3116c7400
commit
d2a5060ad2
@ -1,9 +1,13 @@
|
||||
FROM thecodingmachine/workadventure-back-base:latest as builder
|
||||
WORKDIR /var/www/messages
|
||||
COPY --chown=docker:docker messages .
|
||||
RUN yarn install && yarn proto
|
||||
|
||||
FROM thecodingmachine/nodejs:12
|
||||
|
||||
COPY --chown=docker:docker back .
|
||||
COPY --chown=docker:docker messages ../messages
|
||||
COPY --from=builder --chown=docker:docker /var/www/messages /var/www/messages
|
||||
RUN yarn install
|
||||
RUN cd /usr/src/messages && yarn install && yarn proto
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
|
@ -1,10 +1,14 @@
|
||||
FROM thecodingmachine/workadventure-back-base:latest as builder
|
||||
WORKDIR /var/www/messages
|
||||
COPY --chown=docker:docker messages .
|
||||
RUN yarn install && yarn proto
|
||||
|
||||
# we are rebuilding on each deploy to cope with the API_URL environment URL
|
||||
FROM thecodingmachine/nodejs:14-apache
|
||||
|
||||
COPY --chown=docker:docker front .
|
||||
COPY --chown=docker:docker messages /var/www/messages
|
||||
COPY --from=builder --chown=docker:docker /var/www/messages /var/www/messages
|
||||
RUN yarn install
|
||||
RUN cd /var/www/messages && yarn install && yarn proto
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV STARTUP_COMMAND_1="yarn run build"
|
||||
|
Loading…
Reference in New Issue
Block a user