-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (25 loc) · 908 Bytes
/
Dockerfile
File metadata and controls
35 lines (25 loc) · 908 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
27
28
29
30
31
32
33
34
35
ARG TARGETOS
ARG TARGETARCH
# Build stage
FROM --platform=${TARGETOS}/${TARGETARCH} node:alpine AS build
WORKDIR /torapi
# Install dependencies
COPY package.json ./
RUN npm install && npm update && npm cache clean --force
COPY . .
# Final stage
FROM --platform=${TARGETOS}/${TARGETARCH} 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 proxy server connection via env file or params run
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"]