-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (18 loc) · 772 Bytes
/
Dockerfile
File metadata and controls
26 lines (18 loc) · 772 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
FROM node:12-alpine
WORKDIR /app
COPY tsconfig.json ./
COPY serverless.yml ./serverless.yml
# Remove the typescript build plugin from the serverless file, we build manually
# in docker so that the output is always the same (and ready at the start) in the
# actual artifact
RUN echo "$(awk '!/serverless-plugin-typescript/' serverless.yml)" > serverless.yml
# Point the serverless handlers to the typescript compiled .build directory
RUN echo "$(sed -E 's|handler: src\/handler\.(.*)|handler: \.build\/handler\.\1|g' serverless.yml)" > serverless.yml
COPY package.json ./
COPY package-lock.json ./
RUN npm ci
COPY src ./
RUN npm run build
EXPOSE 3000
EXPOSE 3002
CMD ["node", "./node_modules/serverless/bin/serverless.js", "offline", "start", "--host", "0.0.0.0"]