summaryrefslogtreecommitdiff
path: root/Dockerfile
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile26
1 files changed, 26 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..5c38111
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,26 @@
+FROM golang:1.26-alpine3.23 AS build-stage
+
+RUN apk add --no-cache sqlite-dev musl-dev gcc
+
+WORKDIR /builddir
+COPY . .
+RUN CGO_ENABLED=1 go build -o sayana-web .
+
+FROM alpine:3.23 AS runtime-stage
+
+ENV ENVIRONMENT=""
+ENV AUTH_SALT=""
+ENV B2_KEY_ID=""
+ENV B2_APPLICATION_KEY=""
+
+WORKDIR /app
+COPY --from=build-stage /builddir/sayana-web /app/sayana-web
+COPY --from=build-stage /builddir/migrations /app/migrations
+COPY --from=build-stage /builddir/static /app/static
+COPY --from=build-stage /builddir/views /app/views
+COPY --from=build-stage /builddir/locale/*.yaml /app/locale/
+COPY --from=build-stage /builddir/config/config*.yaml /app/config/
+
+RUN apk add --no-cache tzdata sqlite
+
+ENTRYPOINT /app/sayana-web -c /app/config/config.${ENVIRONMENT}.yaml