-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (26 loc) · 847 Bytes
/
Dockerfile
File metadata and controls
41 lines (26 loc) · 847 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:18 as build
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
git curl bash build-essential libssl-dev ca-certificates imagemagick && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY ./package*.json ./yarn*.lock ./
ENV NODE_ENV='production'
RUN echo "use npmjs.org registry"
RUN npm install
COPY ./ ./
FROM node:18
LABEL org.opencontainers.image.source https://github.com/cloudtype-examples/ai-slackbot-js.git
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
git curl bash build-essential libssl-dev ca-certificates imagemagick && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=build --chown=node:node /app/ ./
RUN chown -f node:node /app && rm -rf .git*
ENV NODE_ENV='production'
USER node
EXPOSE 3000
CMD npm start