mirror of
https://github.com/wassname/talk.git
synced 2026-07-01 02:33:03 +08:00
76d198f2a6
* feat: docker + compression support + headers * fixed bug with dependancies
42 lines
823 B
Docker
42 lines
823 B
Docker
FROM node:8-alpine
|
|
|
|
# Install installation 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
|
|
ENV REVISION_HASH=${REVISION_HASH}
|
|
|
|
CMD ["npm", "run", "start"]
|