-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
50 lines (32 loc) · 1.24 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
FROM node:22 as build
WORKDIR /usr/local/bin
RUN wget https://raw.githubusercontent.com/VirtusLab/scala-cli/main/scala-cli.sh && \
mv scala-cli.sh scala-cli && \
chmod +x scala-cli && \
scala-cli config power true && \
scala-cli version && \
echo '@main def hello = println(42)' | scala-cli run _ --js -S 3.5.1
WORKDIR /scratch
COPY shared/ ./shared/
COPY backend/project.scala backend/project.scala
RUN cd backend && scala-cli compile project.scala --server=false
COPY frontend/src/project.scala frontend/src/project.scala
RUN cd frontend/src && scala-cli compile project.scala --server=false
WORKDIR /source/frontend
COPY frontend/package.json .
COPY frontend/package-lock.json .
RUN npm install
WORKDIR /source
COPY shared/ ./shared/
COPY frontend/ ./frontend/
WORKDIR /source/frontend
RUN rm -rf frontend/.scala-build frontend/.bsp frontend/.bloop
RUN npm run buildDocker
COPY backend/ /source/backend/
RUN rm -rf backend/.scala-build backend/.bsp backend/.bloop
WORKDIR /source/backend
RUN scala-cli package . --assembly -f -o ./optimizer-backend --offline --server=false
FROM ghcr.io/graalvm/jdk-community:23
COPY --from=build /source/backend/optimizer-backend /app/optimizer-backend
EXPOSE 9999
CMD ["/app/optimizer-backend"]