-
Notifications
You must be signed in to change notification settings - Fork 684
/
dev.dockerfile
42 lines (34 loc) · 1.18 KB
/
dev.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
##############################################################
# This file is intended to be used with ./docker-compose.yml #
##############################################################
FROM node:18.16.1-alpine as build
# working directory
WORKDIR /usr/src/app
# global environment setup : yarn + dependencies needed to support node-gyp
RUN apk --no-cache --virtual add \
python3 \
make \
g++ \
yarn
# set env variable for CI
ENV CI=true
# copy root dependency files and configs needed for install
COPY package.json yarn.lock babel.config.js magento-compatibility.js ./
COPY scripts/monorepo-introduction.js ./scripts/monorepo-introduction.js
# copy over the packages
COPY packages ./packages
# run yarn again to reestablish workspace symlinks
RUN yarn install --frozen-lockfile
# build the app
RUN yarn run build
# MULTI-STAGE BUILD
FROM node:18.16.1-alpine
# working directory
WORKDIR /usr/src/app
# node:alpine comes with a configured user and group
RUN chown -R node:node /usr/src/app
# copy build from previous stage
COPY --chown=node:node --from=build /usr/src/app .
USER node
# command to run application
CMD [ "yarn", "workspace", "@magento/venia-concept", "run", "watch"]