forked from aligent/serverless-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-offline
38 lines (26 loc) · 1.06 KB
/
Dockerfile-offline
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
FROM node:16.11-buster-slim
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 mkdir -p /usr/share/man/man1
ARG DEBIAN_INTERACTIVE=noninteractive
RUN apt-get update && \
apt-get --no-install-recommends --assume-yes --quiet \
install sudo python3-setuptools python3-dev python3-pip python3-wheel default-jre curl gnupg make g++ && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/apk/*
RUN pip3 install awscli
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/
RUN curl -o- -L https://yarnpkg.com/install.sh | bash
COPY --chown=node:node package.json ./
COPY --chown=node:node package-lock.json ./
RUN npm ci
RUN serverless.js --version
WORKDIR /app
USER root
COPY entrypoint.sh /docker-entrypoint.sh
RUN chmod 0755 /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]