2020-05-01 14:08:30 +02:00
|
|
|
# ---------------
|
|
|
|
# Install Dependencies
|
|
|
|
# ---------------
|
|
|
|
FROM node:12-alpine as build
|
2020-04-12 18:27:01 +02:00
|
|
|
|
2020-05-01 14:08:30 +02:00
|
|
|
# Install dependencies neccesary for node-gyp on node alpine
|
|
|
|
RUN apk add --update --no-cache \
|
|
|
|
python \
|
|
|
|
make \
|
|
|
|
g++
|
2020-04-12 18:27:01 +02:00
|
|
|
|
|
|
|
# Install app dependencies
|
2020-05-01 14:08:30 +02:00
|
|
|
COPY package.json .
|
|
|
|
COPY yarn.lock .
|
2020-05-07 13:51:39 +02:00
|
|
|
RUN yarn install --silent --prod
|
2020-05-01 14:08:30 +02:00
|
|
|
RUN yarn add --dev cross-env
|
|
|
|
|
|
|
|
# ---------------
|
|
|
|
# Build App
|
|
|
|
# ---------------
|
|
|
|
FROM node:12-alpine
|
|
|
|
|
2020-05-07 13:51:39 +02:00
|
|
|
WORKDIR /app
|
|
|
|
|
2020-05-01 14:08:30 +02:00
|
|
|
# Copy dependencies from build stage
|
|
|
|
COPY --from=build node_modules node_modules
|
2020-04-12 18:27:01 +02:00
|
|
|
|
|
|
|
# Bundle app source
|
2020-05-01 14:08:30 +02:00
|
|
|
COPY . .
|
2020-04-16 10:57:22 +02:00
|
|
|
RUN yarn build
|
2020-04-12 18:27:01 +02:00
|
|
|
EXPOSE 3000
|
2020-04-13 07:30:19 +02:00
|
|
|
|
2020-04-16 10:57:22 +02:00
|
|
|
CMD [ "yarn", "start" ]
|