summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authorSaumit Dinesan <justsaumit@protonmail.com>2023-12-25 00:17:20 +0530
committerSaumit Dinesan <justsaumit@protonmail.com>2023-12-25 00:17:20 +0530
commitbb0cb6e2695711e3c6bb8df221e2bd95e5f27c85 (patch)
tree3f291ae28051472e67eaf3ef4f36161886608248 /Dockerfile
parentf15da3209e65dcff8f2836e5d3ce4179b3117426 (diff)
Dockerfile & README.md: Containerizing the API and completing the TODO, adding TODO for Docker Image size optimization
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile21
1 files changed, 21 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..41a64e1
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,21 @@
+#FROM golang:1.21.5-bullseye - debian/ubuntu has build dependencies(gcc)
+FROM golang:1.21.5-alpine
+
+RUN mkdir /app
+
+ADD . /app
+
+WORKDIR /app
+
+#Install the build dependencies
+RUN apk add --no-cache gcc libc-dev
+
+#CGO_ENABLED=1 for go-sqlite3 to work
+RUN CGO_ENABLED=1 go build -o main .
+
+# Volume for SSL/TLS Certificates(optional for development)
+VOLUME /certs
+
+EXPOSE 3000
+
+CMD ["/app/main"]