-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
95 lines (66 loc) · 2.48 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
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
ARG VERSION=2025.1.0-rc8
# build server
FROM golang:1.19-buster AS server-build-stage
ARG VERSION
ENV BUILD_OS=linux
ENV BUILD_ARCH=amd64
ENV BUILD_VERSION=${VERSION}
WORKDIR /corta
COPY ./server ./
RUN make release-clean release
# build ui
FROM bitnami/node:16.20.2 AS ui-build-stage
ARG VERSION
# for test
ENV BUILD_VERSION=${VERSION}
WORKDIR /corta
COPY ./client ./client
COPY ./lib ./lib
RUN cd /corta/client/web/one ; yarn install ; yarn build
RUN cd /corta/client/web/admin ; yarn install ; yarn build
RUN cd /corta/client/web/compose ; yarn install ; yarn build
RUN cd /corta/client/web/discovery ; yarn install ; yarn build
RUN cd /corta/client/web/privacy ; yarn install ; yarn build
RUN cd /corta/client/web/reporter ; yarn install ; yarn build
RUN cd /corta/client/web/workflow ; yarn install ; yarn build
# deploy stage
FROM ubuntu:20.04
RUN apt-get -y update \
&& apt-get -y install \
ca-certificates \
curl \
&& rm -rf /var/lib/apt/lists/*
# install dart-sass
ARG SASS_VERSION=1.69.5
ARG SASS_URL=https://github.com/sass/dart-sass/releases/download/${SASS_VERSION}/dart-sass-${SASS_VERSION}-linux-x64.tar.gz
WORKDIR /opt
RUN curl -sOL $SASS_URL
RUN tar -xzf dart-sass-${SASS_VERSION}-linux-x64.tar.gz
RUN rm -f dart-sass-${SASS_VERSION}-linux-x64.tar.gz
# install corta server
WORKDIR /corta
ENV STORAGE_PATH="/data"
ENV HTTP_ADDR="0.0.0.0:80"
ENV HTTP_WEBAPP_ENABLED="true"
ENV HTTP_WEBAPP_BASE_DIR="/corta/webapp"
ENV PATH="/opt/dart-sass:/corta/bin:${PATH}"
ENV LOCALE_PATH="/corta/locale"
ENV LOCALE_LANGUAGES="ru,en"
ENV CORREDOR_ADDR="corredor:80"
VOLUME /data
COPY --from=server-build-stage /corta/build/pkg/corteza-server ./
# install corta client
COPY --from=ui-build-stage /corta/client/web/one/dist /corta/webapp
COPY --from=ui-build-stage /corta/client/web/admin/dist /corta/webapp/admin
COPY --from=ui-build-stage /corta/client/web/compose/dist /corta/webapp/compose
COPY --from=ui-build-stage /corta/client/web/discovery/dist /corta/webapp/discovery
COPY --from=ui-build-stage /corta/client/web/privacy/dist /corta/webapp/privacy
COPY --from=ui-build-stage /corta/client/web/reporter/dist /corta/webapp/reporter
COPY --from=ui-build-stage /corta/client/web/workflow/dist /corta/webapp/workflow
# install localization files
COPY ./locale /corta/locale
HEALTHCHECK --interval=30s --start-period=1m --timeout=30s --retries=3 \
CMD curl --silent --fail --fail-early http://127.0.0.1:80/healthcheck || exit 1
EXPOSE 80
ENTRYPOINT ["./bin/corteza-server"]
CMD ["serve-api"]