-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
29 additions
and
22 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 |
---|---|---|
@@ -1,20 +1,29 @@ | ||
FROM alpine:3.18.4 | ||
FROM alpine:3.18.4 as entry | ||
RUN apk add --no-cache npm && npm install -g [email protected] @types/[email protected] | ||
COPY entry.ts . | ||
RUN tsc \ | ||
--noUnusedLocals \ | ||
--noUnusedParameters \ | ||
--strict \ | ||
--typeRoots /usr/local/lib/node_modules/@types \ | ||
entry.ts \ | ||
&& chmod +x entry.js | ||
|
||
FROM alpine:3.18.4 | ||
ENV PIP_DISABLE_PIP_VERSION_CHECK=1 | ||
ENV PIP_NO_CACHE_DIR=1 | ||
|
||
# Dependencies | ||
# Install all dependencies. As the last step of this RUN, we delete unused files | ||
# found by running `apk add ncdu && ncdu` inside `make shell` | ||
RUN apk add --no-cache --virtual .build-deps \ | ||
gcc \ | ||
musl-dev \ | ||
npm \ | ||
py3-pip \ | ||
python3-dev \ | ||
&& apk add --no-cache \ | ||
clang-extra-tools \ | ||
libxslt \ | ||
nodejs \ | ||
openjdk17-jre-headless \ | ||
py3-pip \ | ||
python3 \ | ||
&& pip3 install \ | ||
autoflake==1.7.8 \ | ||
|
@@ -28,11 +37,11 @@ RUN apk add --no-cache --virtual .build-deps \ | |
&& chmod +x /usr/bin/black21 \ | ||
&& npm install -g \ | ||
@prettier/[email protected] \ | ||
@types/[email protected] \ | ||
[email protected] \ | ||
[email protected] \ | ||
[email protected] \ | ||
&& apk del .build-deps \ | ||
&& wget https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/master-f7f02c1d/clang-format-17_linux-amd64 -O clang-format \ | ||
&& chmod +x clang-format \ | ||
&& wget https://github.com/google/google-java-format/releases/download/v1.18.1/google-java-format-1.18.1-all-deps.jar -O google-java-format \ | ||
&& wget https://search.maven.org/remotecontent?filepath=com/facebook/ktfmt/0.46/ktfmt-0.46-jar-with-dependencies.jar -O ktfmt \ | ||
&& wget https://github.com/mvdan/sh/releases/download/v3.7.0/shfmt_v3.7.0_linux_amd64 -O shfmt \ | ||
|
@@ -49,19 +58,17 @@ RUN apk add --no-cache --virtual .build-deps \ | |
-r sonatype:snapshots --main org.scalafmt.cli.Cli \ | ||
--standalone \ | ||
-o scalafmt \ | ||
&& rm /bin/coursier | ||
|
||
&& touch /emptyfile \ | ||
&& rm -rf \ | ||
/bin/coursier \ | ||
/black21-venv/lib/python3.11/site-packages/pip \ | ||
/black21-venv/lib/python3.11/site-packages/pkg_resources \ | ||
/black21-venv/lib/python3.11/site-packages/setuptools \ | ||
/root/.cache \ | ||
/root/.npm \ | ||
/usr/bin/lto-dump \ | ||
/var/cache | ||
# https://stackoverflow.com/a/59485924 | ||
COPY --from=golang:1.22.3-alpine3.18 /usr/local/go/bin/gofmt /gofmt | ||
|
||
# Local files | ||
COPY . . | ||
RUN tsc \ | ||
--noUnusedLocals \ | ||
--noUnusedParameters \ | ||
--strict \ | ||
--typeRoots /usr/local/lib/node_modules/@types \ | ||
entry.ts \ | ||
&& mv entry.js entry \ | ||
&& chmod +x entry \ | ||
&& touch /emptyfile | ||
COPY --from=entry /entry.js /entry |
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
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