-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
30 lines (25 loc) · 802 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
FROM node:lts as build
# Install Deno
RUN apt-get update && \
apt-get install -y curl unzip && \
curl -fsSL https://deno.land/x/install/install.sh | sh && \
ln -s /root/.deno/bin/deno /usr/local/bin/deno
WORKDIR /app
RUN deno --version
COPY package.json package-lock.json ./
RUN npm install
COPY . .
RUN npm run build
# Stage 2
FROM node:lts as prod
# Install Deno
RUN apt-get update && \
apt-get install -y curl unzip && \
curl -fsSL https://deno.land/x/install/install.sh | sh && \
ln -s /root/.deno/bin/deno /usr/local/bin/deno
WORKDIR /app
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/package.json ./
COPY --from=build /app/dist ./dist
EXPOSE 3000
CMD ["deno", "run", "--allow-net", "--allow-read", "--allow-env", "./dist/server/entry.mjs"]