forked from aligent/serverless-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (23 loc) · 976 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
FROM node:16.11-alpine3.14
COPY .serverlessrc /home/node/.serverlessrc
RUN mkdir /app /serverless /home/node/.config /home/node/.serverless
RUN chown node:node /app /serverless /home/node/.config /home/node/.serverless /home/node/.serverlessrc
RUN apk update && \
apk add \
sudo python3 py3-pip bash shadow make g++ groff less && \
pip3 --no-cache-dir install --upgrade awscli && \
rm -rf /var/cache/apk/*
USER node
WORKDIR /serverless
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
ENV PATH=$PATH:/home/node/.npm-global/bin:/serverless/node_modules/serverless/bin/
COPY --chown=node:node package.json ./
COPY --chown=node:node package-lock.json ./
RUN npm ci && serverless.js --version
RUN ln /serverless/node_modules/serverless/bin/serverless.js /serverless/node_modules/serverless/bin/serverless
WORKDIR /app
USER root
COPY entrypoint.sh /docker-entrypoint.sh
RUN chmod 0755 /docker-entrypoint.sh
EXPOSE 9229
ENTRYPOINT ["/docker-entrypoint.sh"]