FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
dockerfiles/node-pkg/Dockerfile at master · numToStr/dockerfiles · GitHub
numToStr
/
dockerfiles
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Issues
1
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
dockerfiles
/
node-pkg
/
Dockerfile
Copy path
More file actions
More file actions
Latest commit
History
History
History
27 lines (23 loc) · 837 Bytes
Breadcrumbs
dockerfiles
/
node-pkg
/
Dockerfile
Copy path
File metadata and controls
27 lines (23 loc) · 837 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#
This setup uses multi stage build for copying build files
#
pkg docs: https://github.com/zeit/pkg
#
In the builder stage
#
pkg bundles of source code and node environment to make a executable binary
#
At line 18, index is the binary name of our source code
#
If you want to change the name of the binary
#
Make sure you also change all the reference of the binary name i.e. line 26 and line 27
#
Builder Stage =======
FROM
node:lts-alpine AS builder
RUN
mkdir -p /usr/src/build
WORKDIR
/usr/src/build
COPY
package*.json ./
RUN
npm i --production && npm i -g pkg
COPY
. .
RUN
pkg -t alpine-x64 -o index .
#
Deploy Stage =======
FROM
alpine:latest
RUN
apk update && apk add --no-cache libstdc++ libgcc
RUN
mkdir -p /usr/src/app
WORKDIR
/usr/src/app
EXPOSE
5000
COPY
--from=builder /usr/src/build/index /usr/src/app
CMD
[
"./index"
]
Back
|
FazBrowse Home
|
New Git URL