Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ WebDriverAgent/
.eslintcache
scripts/
.mypy_cache
.build
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ node_modules/
/playwright-report/
/blob-report/
/playwright/.cache/

.build
patches
25 changes: 8 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -------- BUILDER --------
FROM node:20.18.0-bullseye-slim AS builder
FROM --platform=linux/amd64 node:20.19.0-bullseye-slim AS builder

WORKDIR /app

Expand All @@ -10,28 +10,19 @@ RUN apt-get update && apt-get install -y \

COPY . .

RUN sed -i 's%./node_modules/.bin/tsx%node%g' ./bin/stf.mjs && \
npm ci --python="/usr/bin/python3" --loglevel http && \
./node_modules/.bin/tsc -p tsconfig.node.json && \
RUN npm ci --python="/usr/bin/python3" --loglevel http && \
npm prune --production


WORKDIR /app/ui

RUN npm ci && \
npx tsc -b && \
npx vite build

# -------- RUNTIME --------
FROM node:20.18.0-bullseye-slim
FROM --platform=linux/amd64 node:20.19.0-bullseye-slim

LABEL org.opencontainers.image.source=https://github.com/VKCOM/devicehub
LABEL org.opencontainers.image.title=DeviceHub
LABEL org.opencontainers.image.vendor=VKCOM
LABEL org.opencontainers.image.description="Control and manage Android and iOS devices from your browser."
LABEL org.opencontainers.image.licenses=Apache-2.0

ENV PATH=/app/bin:$PATH
ENV PATH=/app/.build/bin:$PATH
ENV NODE_OPTIONS="--max-old-space-size=32768"

EXPOSE 3000
Expand All @@ -47,10 +38,10 @@ COPY --from=builder /app .
RUN rm -rf ./ui
COPY --from=builder /app/ui/dist ./ui/dist

RUN ln -s /app/bin/stf.mjs /app/bin/stf && \
ln -s /app/bin/stf.mjs /app/bin/devicehub && \
ln -s /app/bin/stf.mjs /app/bin/dh
RUN ln -s /app/.build/bin/stf.mjs /app/.build/bin/stf && \
ln -s /app/.build/bin/stf.mjs /app/.build/bin/devicehub && \
ln -s /app/.build/bin/stf.mjs /app/.build/bin/dh

USER devicehub-user

CMD ["devicehub", "--help"]
CMD ["devicehub", "--help"]
Loading
Loading