Skip to content

Commit 7b7ddb2

Browse files
committed
added versions to packages in Dockerfile; changed s3proxy calls to async
1 parent ecd6b04 commit 7b7ddb2

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:current-alpine@sha256:ab3603cb7934b21f1ffb522b1a1d538809516c6e4cd73b144716bc1830aad1a6 as base
1+
FROM node:current-alpine@sha256:cc4e8f3d78a276fa05eae1803b6f8cbb43145441f54c828ab14e0c19dd95c6fd as base
22

33
ARG VERSION
44
WORKDIR /src
@@ -9,12 +9,12 @@ COPY package.json package-lock.json express-s3proxy.js ./
99
HEALTHCHECK --interval=60s CMD curl -f http://localhost:${PORT}/health || exit 1
1010
RUN apk --update-cache upgrade \
1111
&& npm ci --only=production \
12-
&& apk add --no-cache curl tini \
12+
&& apk add --no-cache curl~=8 tini~=0.19 \
1313
&& npm cache clean --force \
1414
&& rm -rf ~/.npm
1515

1616
FROM base as test
17-
RUN apk add --no-cache jq~=1.6 bash~=5.1.16
17+
RUN apk add --no-cache jq~=1.6 bash~=5.2
1818
USER node
1919
ENV DEBUG=s3proxy,express NODE_ENV=development
2020
ENTRYPOINT ["/sbin/tini", "--"]

express-s3proxy.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ app.get('/health', (req, res) => {
9393
})
9494

9595
// health check s3
96-
app.get('/health/s3', (req, res) => {
97-
proxy.healthCheckStream(res).on('error', () => {
96+
app.get('/health/s3', async (req, res) => {
97+
(await proxy.healthCheckStream(res)).on('error', () => {
9898
// just end the request and let the HTTP status code convey the error
9999
res.end()
100100
}).pipe(res)
@@ -117,8 +117,8 @@ app.route('/*')
117117
await proxy.head(req, res)
118118
res.end()
119119
})
120-
.get((req, res) => {
121-
proxy.get(req, res).on('error', (err) => {
120+
.get(async (req, res) => {
121+
(await proxy.get(req, res)).on('error', (err) => {
122122
handleError(req, res, err)
123123
}).pipe(res)
124124
})

0 commit comments

Comments
 (0)