mirror of
https://github.com/SphericalKat/medium.rip.git
synced 2024-12-26 17:45:57 +00:00
feat: deploy via fly.io
Signed-off-by: Sphericalkat <amolele@gmail.com>
This commit is contained in:
parent
8b3a6b9aae
commit
2eacfa702a
5
.dockerignore
Normal file
5
.dockerignore
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
.env
|
||||||
|
frontend/node_modules
|
||||||
|
frontend/dist
|
||||||
|
Dockerfile
|
||||||
|
response.json
|
23
Dockerfile
Normal file
23
Dockerfile
Normal file
@ -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" ]
|
14
fly.toml
Normal file
14
fly.toml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# fly.toml app configuration file generated for medium-rip on 2023-05-28T18:53:27+05:30
|
||||||
|
#
|
||||||
|
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
|
||||||
|
#
|
||||||
|
|
||||||
|
app = "medium-rip"
|
||||||
|
primary_region = "sin"
|
||||||
|
|
||||||
|
[http_service]
|
||||||
|
internal_port = 8080
|
||||||
|
force_https = true
|
||||||
|
auto_stop_machines = true
|
||||||
|
auto_start_machines = true
|
||||||
|
min_machines_running = 0
|
@ -4,8 +4,8 @@
|
|||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite build --watch",
|
||||||
"build": "vite build --watch",
|
"build": "vite build",
|
||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
|
Loading…
Reference in New Issue
Block a user