This repository has been archived by the owner on Nov 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
62 lines (46 loc) · 2.08 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
FROM ubuntu:22.04
# Update the package manager
RUN apt-get update
# Install OpenJDK 17
RUN apt-get install -y openjdk-17-jdk
# Install wget and curl
RUN apt-get install -y wget curl
# Install Leiningen 2.9.1
RUN wget https://raw.githubusercontent.com/technomancy/leiningen/2.9.1/bin/lein \
&& mv lein /usr/local/bin/ \
&& chmod +x /usr/local/bin/lein \
&& lein
# Install Clojure
RUN wget https://download.clojure.org/install/linux-install-1.10.3.986.sh \
&& chmod +x linux-install-1.10.3.986.sh \
&& ./linux-install-1.10.3.986.sh
# Install Node.js LTS and npm
RUN apt-get install -y curl \
&& curl -sL https://deb.nodesource.com/setup_lts.x | bash - \
&& apt-get install -y nodejs \
&& npm install npm@latest -g
RUN npm install -g [email protected]
# Create an empty directory for the application
RUN mkdir /app
# Copy single file project.clj into the Docker image
COPY project.clj /app/
# Set the working directory to /app
WORKDIR /app
# Install project dependencies using lein before copying the code for caching
# This container image layer is a fairly large one and we would like to rebuild it
# little as possible. Hence, we copy the full codebase later.
RUN XTDB_ENABLE_BYTEUTILS_SHA1=true lein deps
# Copy the current directory into the container
COPY . /app
RUN npm install @webcomponents/[email protected] --save \
&& cp node_modules/@webcomponents/custom-elements/custom-elements.min.js resources/public/js/custom-elements.min.js \
&& npm install @clr/[email protected] --save \
&& cp node_modules/@clr/icons/clr-icons.min.css resources/public/css/clr-icons.min.css \
&& cp node_modules/@clr/icons/clr-icons.min.js resources/public/js/clr-icons.min.js \
&& rm -rf node_modules
RUN mkdir -p ~/.kosa tmp/storage resources/storage
RUN XTDB_ENABLE_BYTEUTILS_SHA1=true lein scss :development once \
&& XTDB_ENABLE_BYTEUTILS_SHA1=true lein cljsbuild once \
&& XTDB_ENABLE_BYTEUTILS_SHA1=true lein db-migrate dev \
&& XTDB_ENABLE_BYTEUTILS_SHA1=true lein db-seed dev
CMD ["sh", "-c", "XTDB_ENABLE_BYTEUTILS_SHA1=true lein run -- -sf config/config.dev.edn"]