forked from schnaq/schnaq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.frontend
49 lines (36 loc) · 1.28 KB
/
Dockerfile.frontend
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
FROM clojure:temurin-17-alpine AS shadow-build
WORKDIR /code
# Cache and install Clojure dependencies
ARG DATOMIC_REPO_USERNAME
ENV DATOMIC_REPO_USERNAME=$DATOMIC_REPO_USERNAME
ARG DATOMIC_REPO_PASSWORD
ENV DATOMIC_REPO_PASSWORD=$DATOMIC_REPO_PASSWORD
COPY settings.xml /root/.m2/settings.xml
# ------------------------------------------------------------------------------
ARG REST_API_URL
ARG BUILD_HASH
ARG KEYCLOAK_CLIENT
ARG KEYCLOAK_REALM
ARG FAQ_SHARE_HASH
RUN apk add --no-cache yarn && \
yarn global add sass
# Cache and install JavaScript dependencies
COPY package.json .
COPY yarn.lock .
COPY resources/public/node_modules/ resources/public/node_modules/
RUN yarn install
COPY deps.edn .
RUN clojure -P -M:frontend
COPY . .
RUN sass ./resources/public/css/main.scss ./resources/public/css/main.min.css --no-source-map --style compressed
RUN yarn shadow-cljs release app
# ------------------------------------------------------------------------------
FROM nginx:alpine
# Default value is robots.txt, only on other environments a custom var is needed
ARG ROBOTS_TXT=./robots.txt
RUN apk add --no-cache tzdata
WORKDIR /usr/share/nginx/html
COPY --from=shadow-build /code/resources/public .
COPY nginx/schnaq.conf /etc/nginx/conf.d/default.conf
COPY ${ROBOTS_TXT} ./robots.txt
EXPOSE 80