generated from accelerator-blueprints/base-blueprint
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
48 lines (37 loc) · 1.39 KB
/
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
46
47
48
###
# Build:
# docker build . -t hello-world-rest --tag local --build-arg VERSION=local
# Run:
# docker run --rm -it -p 8080:3000 hello-world-rest
# Tag and Push
# docker tag hello-world-rest:local cloudkats/hello-world-rest:local
# docker push cloudkats/hello-world-rest:local
###
FROM node:18-alpine@sha256:c7620fdecfefb96813da62519897808775230386f4c8482e972e37b8b18cb460
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY app/package*.json ./
RUN npm install
# Bundle app source
COPY app/ .
EXPOSE 3000
ARG VERSION
ENV VERSION=$VERSION
# hadolint ignore=DL3016,DL3018
RUN apk add --update --no-cache \
curl bash; \
rm -rf /var/cache/apk/*;
# Metadata
LABEL org.opencontainers.image.authors="[email protected]" \
org.opencontainers.image.vendor="https://github.com/cloudkats" \
org.opencontainers.image.title="cloudkats/hello-world-rest" \
org.opencontainers.image.source="https://github.com/cloudkats/hello-world-rest" \
org.opencontainers.image.documentation="https://github.com/cloudkats/hello-world-rest/readme.md" \
org.opencontainers.image.licenses="https://github.com/cloudkats/hello-world-rest/LICENCE" \
org.opencontainers.image.version="${VERSION}"
COPY entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
CMD [ "node", "./server.js" ]