-
Notifications
You must be signed in to change notification settings - Fork 1
/
dockerfile
32 lines (23 loc) · 827 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
# Build stage
FROM --platform=$BUILDPLATFORM node:alpine AS build
WORKDIR /torapi
# Install dependencies
COPY package.json ./
RUN npm install && npm cache clean --force
COPY . .
# Final stage
FROM --platform=$BUILDPLATFORM node:alpine
WORKDIR /torapi
COPY --from=build /torapi/node_modules ./node_modules
COPY --from=build /torapi/package.json ./package.json
COPY --from=build /torapi/main.js ./main.js
COPY --from=build /torapi/swagger/swagger.js ./swagger/swagger.js
COPY --from=build /torapi/category.json ./category.json
ENV PORT=8443
EXPOSE 8443
# Set variables for connecting through a proxy server
ENV PROXY_ADDRESS=""
ENV PROXY_PORT=""
ENV USERNAME=""
ENV PASSWORD=""
CMD ["sh", "-c", "npm start -- --port $PORT --proxyAddress $PROXY_ADDRESS --proxyPort $PROXY_PORT --username $USERNAME --password $PASSWORD"]