2023-03-10 20:59:56 +00:00
|
|
|
# syntax=docker/dockerfile:1
|
|
|
|
|
2023-05-03 10:26:56 +00:00
|
|
|
FROM --platform=linux/arm64 arm64v8/debian
|
2023-03-10 20:59:56 +00:00
|
|
|
|
2023-03-25 20:15:00 +00:00
|
|
|
EXPOSE 443 80
|
2023-03-10 20:59:56 +00:00
|
|
|
|
|
|
|
VOLUME /config
|
|
|
|
|
2023-05-27 17:11:33 +00:00
|
|
|
RUN apt-get update && apt-get install -y ca-certificates openssl
|
2023-03-25 20:15:00 +00:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
2023-05-27 17:11:33 +00:00
|
|
|
# install go 1.20.2
|
|
|
|
RUN apt-get install -y wget curl
|
2023-05-27 17:27:41 +00:00
|
|
|
RUN wget https://golang.org/dl/go1.20.2.linux-arm64.tar.gz
|
|
|
|
RUN tar -C /usr/local -xzf go1.20.2.linux-arm64.tar.gz
|
2023-05-27 17:11:33 +00:00
|
|
|
ENV PATH=$PATH:/usr/local/go/bin
|
2023-05-27 17:27:41 +00:00
|
|
|
RUN rm go1.20.2.linux-arm64.tar.gz
|
2023-05-27 17:11:33 +00:00
|
|
|
|
|
|
|
# install nodejs 18.16.0
|
|
|
|
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
|
|
|
|
RUN apt-get install -y nodejs
|
|
|
|
|
|
|
|
COPY go.mod ./
|
|
|
|
COPY go.sum ./
|
|
|
|
RUN go mod download
|
|
|
|
|
|
|
|
COPY package.json ./
|
|
|
|
COPY package-lock.json ./
|
|
|
|
RUN npm install
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
RUN ls
|
|
|
|
RUN npm run client-build
|
2023-05-27 17:19:48 +00:00
|
|
|
RUN chmod +x build.sh
|
2023-05-27 17:11:33 +00:00
|
|
|
RUN ./build.sh
|
|
|
|
|
2023-05-27 17:24:58 +00:00
|
|
|
# clean up
|
|
|
|
RUN apt-get remove -y wget curl nodejs
|
|
|
|
RUN apt-get autoremove -y
|
|
|
|
RUN rm -rf node_modules
|
2023-05-27 17:27:06 +00:00
|
|
|
RUN rm -rf /usr/local/go
|
2023-05-27 17:24:58 +00:00
|
|
|
|
2023-05-27 17:11:33 +00:00
|
|
|
WORKDIR /app/build
|
2023-03-10 20:59:56 +00:00
|
|
|
|
|
|
|
CMD ["./cosmos"]
|