-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Add Dockerfile and docker build instructions (#3547)
Many devs using Shaka and wishing to compile the library are required to install all prerequisites on their machine. For docker devs, this is extremely bad as it requires installing Java and Python on OS. This commit adds a basic configuration for quick compilation via Docker, without requiring any other prerequisites. Improvements can be made in order to allow all Shaka workflow inside Docker. Suggested in #181
- Loading branch information
1 parent
bdc5ea7
commit 925de19
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Alpine was chosen by providing a node container less than 100mb | ||
FROM node:17.7.1-alpine3.15 | ||
|
||
WORKDIR /usr/src/app | ||
|
||
# install dependencies | ||
RUN apk add --update --no-cache openssh git python3 openjdk11-jre-headless | ||
RUN ln -sf python3 /usr/bin/python | ||
|
||
# Change to non-root user | ||
USER node | ||
|
||
# Python user's setup | ||
RUN mkdir -p /home/node/.local/bin | ||
ENV PATH="$PATH:/home/node/.local/bin" | ||
RUN python3 -m ensurepip | ||
RUN pip3 install --no-cache --upgrade pip setuptools | ||
|
||
# Prevent proxy timeout error (very slow connections) | ||
RUN npm config set fetch-retry-mintimeout 20000 | ||
RUN npm config set fetch-retry-maxtimeout 120000 | ||
RUN npm config rm proxy | ||
RUN npm config rm https-proxy | ||
|
||
# Run compilation | ||
CMD [ "python", "build/all.py" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: '3' | ||
|
||
services: | ||
shaka-compiler: | ||
build: ./ | ||
container_name: shaka-compiler | ||
volumes: | ||
- ../../:/usr/src/app | ||
|
||
# Others services can be added here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters