-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
41 lines (29 loc) · 864 Bytes
/
Dockerfile.dev
File metadata and controls
41 lines (29 loc) · 864 Bytes
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
FROM node:10-alpine
MAINTAINER Phoomparin Mano <phoomparin@gmail.com>
# Set node environment to development
ENV NODE_ENV development
# Setup the working directory
ENV app /opt/app
RUN mkdir -p $app
WORKDIR $app
# Install system dependencies
RUN apk update && apk --no-cache add python g++ make
# Install PM2
RUN yarn global add pm2
# Copy the package manifest and lockfiles over
COPY package.json yarn.lock /tmp/
# Add the yarn cache to speed up builds
ADD .yarn-cache.tgz /
# Install the application dependencies
RUN cd /tmp && yarn --pure-lockfile
# Link the node modules to the application directory
RUN cd $app && ln -s /tmp/node_modules
# Copy files into workspace
COPY package.json webpack.config.js $app/
COPY src $app/src
# Build the webpack bundle
RUN npx webpack
# Expose Port
EXPOSE 3030
# Start the development server
CMD ["yarn", "start"]