-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContainerfile_as
70 lines (51 loc) · 2.11 KB
/
Containerfile_as
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#*----------------------------------------------------------------------
#* pythonbuild
#*----------------------------------------------------------------------
FROM docker.io/library/python:3.12.3-alpine as pythonbuild
ARG ENABLE_TESTS
ARG PI_DIGITS_FILE=/app/assembly/pi_digits_seed.ts
WORKDIR /app
COPY . /app
RUN apk update && apk upgrade && \
ENABLE_TESTS=$ENABLE_TESTS PI_DIGITS_FILE=$PI_DIGITS_FILE ./etc/gen_run_pytests.sh
#*----------------------------------------------------------------------
#* asbuild
#*----------------------------------------------------------------------
FROM docker.io/library/node:22-alpine as asbuild
ARG ENABLE_TESTS
ARG PI_DIGITS_FILE=/app/assembly/pi_digits_seed.ts
WORKDIR /app
COPY ./etc /app/etc
COPY pi-as /app
COPY --from=pythonbuild $PI_DIGITS_FILE $PI_DIGITS_FILE
RUN apk update && apk upgrade && \
ENABLE_TESTS=$ENABLE_TESTS PI_DIGITS_FILE=$PI_DIGITS_FILE ./etc/build_run_as_tests.sh
#*----------------------------------------------------------------------
#* build
#*----------------------------------------------------------------------
FROM docker.io/library/node:22-alpine as build
ARG ENABLE_TESTS
# ENV TZ=PST8PDT set in docker-compose.yml
WORKDIR /app
COPY . /app
COPY --from=asbuild /app/as-*.* .
# used for integration testing pi-as.wasm: execute `node ./src/pi/pi-as-tester.js` in the container
COPY --from=asbuild /app/pi-as-tester.js ./src/pi/pi-as-tester.js
COPY --from=asbuild /app/build/pi-as.js ./src/pi/pi-as.js
COPY --from=asbuild /app/build/pi-as.wasm* ./src/pi/
COPY --from=pythonbuild /app/piadapter.tgz ./public/piadapter.tgz
COPY --from=pythonbuild /app/python-*.* .
RUN apk update && apk upgrade && \
npm install && \
WASM_LANG=as etc/clean_final.sh && \
rm -fr etc/
## Until I can work through the pyodide build issues ...
EXPOSE 3000
CMD ["npm", "start"]
# RUN npm install && npm run build
#*----------------------------------------------------------------------
#* final
#*----------------------------------------------------------------------
# FROM nginx:mainline-alpine
# RUN apk upgrade --no-cache
# COPY --from=build /app/dist /usr/share/nginx/html