-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
45 lines (33 loc) · 972 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Creates a docker image with node, and your app
#
# Steps:
# - Set meta information
# - Install packages and scripts
# - Copy package.json package-lock.json from app
# - Build node env
# - Copy all source code
# - Build node app
# start from a minimal, bare-bones image
FROM node:10-alpine
# set the working directory to /app
WORKDIR /app
# install base packages
RUN apk add --no-cache bash
# copy the build scripts into image
COPY deploy/build-scripts /usr/local/sbin/
# ensure they're executable
RUN chmod +x /usr/local/sbin/*
# copy the start script into image
COPY deploy/bin /usr/local/bin/
# ensure they're executable
RUN chmod +x /usr/local/bin/*
# add node_modules/.bin to path
ENV PATH="/app/node_modules/.bin:${PATH}"
# copy package.json package-lock.json yarn.lock into image
COPY package*.json /app/
# build node (see build-scripts)
RUN build-node-env
# copy the source code
COPY . .
# build app (see build-scripts)
RUN build-node-app