-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
27 lines (25 loc) · 915 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Stage 1 (base)
FROM node:alpine as base
LABEL [email protected]
LABEL org.opencontainers.image.title="hisabkitab"
LABEL org.opencontainers.image.source=https://github.com/mustanish/hisab-kitab
LABEL org.opencontainers.image.licenses=MIT
LABEL com.hisabkitab.nodeversion=$NODE_VERSION
WORKDIR /usr/src/app
COPY package.json yarn.lock* ./
EXPOSE 3000
## Stage 2 (development)
FROM base as dev
ENV NODE_ENV=development
RUN apk add --no-cache make gcc g++ python bash && \
yarn && yarn cache clean --force && \
apk del make gcc g++ python
CMD [ "/usr/src/app/node_modules/.bin/nodemon","--inspect=0.0.0.0:9229","./bin/www" ]
## Stage 3 (default, production)
FROM base as prod
ENV NODE_ENV=production
RUN apk add --no-cache make gcc g++ python && \
yarn --production && yarn cache clean --force && \
apk del make gcc g++ python
COPY . .
CMD [ "node","./bin/www" ]