aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Ángel Moreno <mail@migalmoreno.com>2023-06-22 19:47:23 +0200
committerMiguel Ángel Moreno <mail@migalmoreno.com>2023-06-22 19:47:23 +0200
commitc7dafc936bdb3e052c20f97e3f991a8011f9e276 (patch)
treeb5b6a9f66567505b1d85fca737a20a096ce76be5
parent30da9b98a66817ab019af3639c04f1dfb32a36a8 (diff)
feat: Add Docker scripts
-rw-r--r--.dockerignore1
-rw-r--r--Dockerfile27
-rw-r--r--docker-compose.yml7
3 files changed, 35 insertions, 0 deletions
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..cf70988
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1 @@
+**/node_modules
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..8ae933f
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,27 @@
+FROM clojure:tools-deps-alpine as build
+
+RUN mkdir /app
+WORKDIR /app
+
+RUN apk add npm
+
+COPY package* /app/
+RUN npm install
+
+COPY . /app
+RUN npm run build
+RUN clojure -M:frontend release tubo
+
+FROM clojure:tools-deps-alpine
+RUN mkdir /app
+WORKDIR /app
+COPY deps.edn /app
+
+RUN clojure -P
+
+COPY . /app
+COPY --from=build /app/resources /app/resources
+
+EXPOSE 3000
+
+CMD clojure -M:run
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..e16485c
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,7 @@
+version: "3"
+services:
+ tubo:
+ build: .
+ restart: unless-stopped
+ ports:
+ - 3000:3000