-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
98 lines (60 loc) · 2.12 KB
/
Copy pathDockerfile
File metadata and controls
98 lines (60 loc) · 2.12 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
FROM golang:1.23 AS test-backend
RUN useradd -ms /bin/sh user
USER user
WORKDIR /app
COPY --chown=user . .
RUN make install-backend-dependencies
CMD ["make", "test-backend"]
FROM node:20.18.0 AS test-unit-frontend
RUN useradd -ms /bin/sh user
USER user
WORKDIR /app
COPY --chown=user . .
RUN make install-frontend-dependencies
CMD ["make", "test-frontend-unit"]
FROM node:20.18.0 AS test-e2e-frontend
RUN apt update
RUN apt install -y xvfb libgtk-3-dev libwebkit2gtk-4.0-dev
RUN wget https://go.dev/dl/go1.23.2.linux-amd64.tar.gz
RUN tar -C /usr/local -xzf go1.23.2.linux-amd64.tar.gz
RUN useradd -ms /bin/sh user
USER user
RUN mkdir /home/user/go
ENV PATH=$PATH:/usr/local/go/bin:/home/user/go/bin
ENV DISPLAY=:1
ENV GOPATH=/home/user/go
WORKDIR /app
COPY --chown=user . .
RUN make install
RUN make frontend-build
RUN make install-frontend-playwright
CMD ["make", "test-frontend-e2e-container"]
FROM golang:bookworm AS linux-build
RUN echo "deb http://deb.debian.org/debian bookworm-backports main" > /etc/apt/sources.list.d/debian-12-backports.list
RUN apt update && apt install -y upx-ucl libwebkit2gtk-4.0-dev
RUN wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
ENV NVM_DIR="/root/.nvm"
WORKDIR /app
COPY . .
RUN . $NVM_DIR/nvm.sh && cd frontend && nvm install
RUN . $NVM_DIR/nvm.sh && make install
RUN go install mvdan.cc/garble@latest
RUN . $NVM_DIR/nvm.sh && wails build -platform linux/amd64 -upx
RUN ls -lah build/bin
CMD ["tail", "-f", "/dev/null"]
FROM golang:1.25.2-alpine3.22 AS alpine-builder
RUN apk update && apk add -q webkit2gtk-4.1-dev wget bash gcc g++ make
ENV NODE_PACKAGE_URL https://unofficial-builds.nodejs.org/download/release/v24.5.0/node-v24.5.0-linux-x64-musl.tar.gz
RUN apk add libstdc++
WORKDIR /opt
RUN wget $NODE_PACKAGE_URL
RUN mkdir -p /opt/nodejs
RUN tar -zxvf *.tar.gz --directory /opt/nodejs --strip-components=1
RUN rm *.tar.gz
RUN ln -s /opt/nodejs/bin/node /usr/local/bin/node
RUN ln -s /opt/nodejs/bin/npm /usr/local/bin/npm
WORKDIR /app
COPY . .
RUN make install
RUN touch frontend/build/.gitignore
RUN wails build -platform linux/amd64 -tags webkit2_41