-
Notifications
You must be signed in to change notification settings - Fork 2k
/
Dockerfile
34 lines (23 loc) · 1.08 KB
/
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
33
34
FROM node:18.17.1-alpine as build
# Create link to node on amd64 so that corepack can find it
RUN if [ "$(uname -m)" == "aarch64" ]; then mkdir -p /usr/local/sbin/ && ln -s /usr/local/bin/node /usr/local/sbin/node; fi
WORKDIR /app
COPY . /app/
RUN apk --update add --virtual native-dep \
make gcc g++ python3 libgcc libstdc++ git && \
(cd /app && corepack yarn workspaces focus @uppy/companion) && \
apk del native-dep
RUN cd /app && corepack yarn workspace @uppy/companion build
# Now remove all non-prod dependencies for a leaner image
RUN cd /app && corepack yarn workspaces focus @uppy/companion --production
FROM node:18.17.1-alpine
WORKDIR /app
# copy required files from build stage.
COPY --from=build /app/packages/@uppy/companion/bin /app/bin
COPY --from=build /app/packages/@uppy/companion/lib /app/lib
COPY --from=build /app/packages/@uppy/companion/package.json /app/package.json
COPY --from=build /app/packages/@uppy/companion/node_modules /app/node_modules
ENV PATH "${PATH}:/app/node_modules/.bin"
CMD ["node","/app/bin/companion"]
# This can be overruled later
EXPOSE 3020