mirror of
https://github.com/wassname/talk.git
synced 2026-06-27 19:33:06 +08:00
6057edcb07
* fix: pinned node and npm versions * fix: addressed issues with package upgrades
29 lines
617 B
Docker
29 lines
617 B
Docker
FROM node:12-alpine
|
|
|
|
# Install build dependancies.
|
|
RUN apk --no-cache add git python
|
|
|
|
# Create app directory.
|
|
RUN mkdir -p /usr/src/app
|
|
WORKDIR /usr/src/app
|
|
|
|
# Bundle application source.
|
|
COPY . /usr/src/app
|
|
|
|
# Store the current git revision.
|
|
ARG REVISION_HASH
|
|
RUN mkdir -p dist/core/common/__generated__ && \
|
|
echo "{\"revision\": \"${REVISION_HASH}\"}" > dist/core/common/__generated__/revision.json
|
|
|
|
# Install build static assets and clear caches.
|
|
RUN npm ci && \
|
|
npm run build && \
|
|
npm prune --production
|
|
|
|
# Setup the environment
|
|
ENV NODE_ENV production
|
|
ENV PORT 5000
|
|
EXPOSE 5000
|
|
|
|
CMD ["npm", "run", "start"]
|