mirror of
https://github.com/SphericalKat/medium.rip.git
synced 2026-10-21 01:34:22 +00:00
feat: deploy via fly.io
Signed-off-by: Sphericalkat <amolele@gmail.com>
This commit is contained in:
1 parent
8b3a6b9aae
commit
2eacfa702a
4 files changed
+44
-2
No files matched your search
+23
@@ -0,0 +1,23 @@
|
||||
# frontend
|
||||
FROM node:16-slim as frontend
|
||||
RUN corepack enable
|
||||
RUN corepack prepare pnpm@latest --activate
|
||||
WORKDIR /app
|
||||
COPY frontend/package.json frontend/pnpm-lock.yaml ./
|
||||
RUN pnpm install --frozen-lockfile
|
||||
COPY frontend/ ./
|
||||
RUN pnpm build
|
||||
|
||||
# backend
|
||||
FROM golang:1.20-alpine as backend
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
RUN rm -rf frontend
|
||||
COPY --from=frontend /app/ ./frontend
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags='-w -s -extldflags "-static"' -a -o medium
|
||||
|
||||
# final
|
||||
FROM debian:bullseye-slim
|
||||
RUN apt-get update && apt-get install -y ca-certificates
|
||||
COPY --from=backend /app/medium /usr/local/bin/medium
|
||||
CMD [ "medium" ]
|
||||
Reference in new issue
Block a user