mirror of
https://github.com/wassname/talk.git
synced 2026-06-27 17:50:42 +08:00
cda72ba249
* feat: added version metadata, release to Docker * fix: fixed mistake with export * fix: adjusted circle cache beheviour * fix: removed node_modules from workspace * fix: added version prefix to cache keys * review: patched invalid job name * fix: hardcode cache version prefix :( * fix: improved cache keys
43 lines
920 B
Docker
43 lines
920 B
Docker
FROM node:8-alpine
|
|
|
|
# Install build dependancies.
|
|
RUN apk --no-cache add git
|
|
|
|
# Create app directory.
|
|
RUN mkdir -p /usr/src/app
|
|
WORKDIR /usr/src/app
|
|
|
|
# Setup the environment for production.
|
|
ENV NODE_ENV production
|
|
|
|
# Bundle application source.
|
|
COPY . /usr/src/app
|
|
|
|
# Install build static assets and clear caches.
|
|
RUN NODE_ENV=development npm install && \
|
|
npm run compile && \
|
|
npm run build && \
|
|
npm prune --production
|
|
|
|
FROM node:8-alpine
|
|
|
|
# Create app directory
|
|
RUN mkdir -p /usr/src/app
|
|
WORKDIR /usr/src/app
|
|
|
|
# Copy the compiled source into the new stage.
|
|
COPY --from=0 /usr/src/app .
|
|
|
|
# Setup the environment
|
|
ENV PATH /usr/src/app/bin:$PATH
|
|
ENV PORT 5000
|
|
EXPOSE 5000
|
|
ENV NODE_ENV production
|
|
|
|
# Store the current git revision.
|
|
ARG REVISION_HASH
|
|
RUN mkdir dist/core/common/__generated__ && \
|
|
echo "{\"revision\": \"${REVISION_HASH}\"}" > dist/core/common/__generated__/revision.json
|
|
|
|
CMD ["npm", "run", "start"]
|