feat: add Docker support with Dockerfile and docker-compose, update API URLs to use base_url
This commit is contained in:
@@ -12,7 +12,10 @@
|
||||
"Bash(grep -rE '\"\"@adapters\"\"' tsconfig*.json babel.config.*)",
|
||||
"Bash(grep -n \"pub struct Line\\\\|pub fn add_shape\\\\|fn add_polygon\\\\|fn add_rect\\\\|PdfLayerReference\" /home/felipecn/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/printpdf-0.7.0/src/*.rs)",
|
||||
"mcp__paper__get_basic_info",
|
||||
"mcp__paper__get_screenshot"
|
||||
"mcp__paper__get_screenshot",
|
||||
"Bash(find /var/home/felipecn/DEV/MeowSpool/backend/bruno-routes -name \"*.yml\" ! -name \"route.yml\" -exec sed -i 's|http://0\\\\.0\\\\.0\\\\.0:8080|{{base_url}}|g; s|https://meowspool\\\\.felipecncloud\\\\.com|{{base_url}}|g' {} +)",
|
||||
"Bash(find /var/home/felipecn/DEV/MeowSpool/backend/bruno-routes -name \"*.yml\" ! -name \"route.yml\" ! -name \"Dashboard.yml\" -exec sed -i 's| url: \\\\\\({{.*}}\\\\\\)| url: \"\"\\\\1\"\"|g' {} +)",
|
||||
"Bash(find /var/home/felipecn/DEV/MeowSpool/backend/bruno-routes -name \"*.yml\" ! -name \"route.yml\" -exec sed -i 's| url: \"\"\\\\?\\\\\\(.*\\\\\\)\"\"\\\\?$| url: \"\"\\\\1\"\"|g; s| url: \"\"\\\\\\(.*\\\\\\)\"\"\"\"\\\\?$| url: \"\"\\\\1\"\"|g' {} +)"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
target/
|
||||
.env
|
||||
.git
|
||||
.gitignore
|
||||
*.md
|
||||
@@ -0,0 +1,40 @@
|
||||
# ── Stage 1: builder ──────────────────────────────────────────────────────────
|
||||
FROM rust:1.88-slim-bookworm AS builder
|
||||
|
||||
# Build dependencies for native libs (OpenSSL via rustls not needed, but sqlx needs pkg-config)
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
pkg-config \
|
||||
libssl-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Cache dependency compilation separately from source
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
|
||||
# Create a dummy main so Cargo can compile deps without our source
|
||||
RUN mkdir src && echo "fn main() {}" > src/main.rs
|
||||
RUN cargo build --release --bin meowspool 2>/dev/null; true
|
||||
|
||||
# Now copy real source and migrations
|
||||
COPY src ./src
|
||||
COPY migrations ./migrations
|
||||
|
||||
# Touch main.rs so Cargo knows it changed, then build for real
|
||||
RUN touch src/main.rs && cargo build --release --bin meowspool
|
||||
|
||||
# ── Stage 2: runtime ──────────────────────────────────────────────────────────
|
||||
FROM debian:bookworm-slim AS runtime
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /app/target/release/meowspool ./meowspool
|
||||
COPY --from=builder /app/migrations ./migrations
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["./meowspool"]
|
||||
@@ -5,7 +5,7 @@ info:
|
||||
|
||||
http:
|
||||
method: POST
|
||||
url: http://0.0.0.0:8080/api/v1/auth/forgot-password
|
||||
url: "{{base_url}}/api/v1/auth/forgot-password"
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
|
||||
@@ -5,7 +5,7 @@ info:
|
||||
|
||||
http:
|
||||
method: POST
|
||||
url: https://meowspool.felipecncloud.com/api/v1/auth/login
|
||||
url: "{{base_url}}/api/v1/auth/login"
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
|
||||
@@ -5,7 +5,7 @@ info:
|
||||
|
||||
http:
|
||||
method: POST
|
||||
url: http://0.0.0.0:8080/api/v1/auth/logout
|
||||
url: "{{base_url}}/api/v1/auth/logout"
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
|
||||
@@ -5,7 +5,7 @@ info:
|
||||
|
||||
http:
|
||||
method: POST
|
||||
url: http://0.0.0.0:8080/api/v1/auth/oauth/google
|
||||
url: "{{base_url}}/api/v1/auth/oauth/google"
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
|
||||
@@ -5,7 +5,7 @@ info:
|
||||
|
||||
http:
|
||||
method: POST
|
||||
url: http://0.0.0.0:8080/api/v1/auth/refresh
|
||||
url: "{{base_url}}/api/v1/auth/refresh"
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
|
||||
@@ -5,7 +5,7 @@ info:
|
||||
|
||||
http:
|
||||
method: POST
|
||||
url: http://0.0.0.0:8080/api/v1/auth/register
|
||||
url: "{{base_url}}/api/v1/auth/register"
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
|
||||
@@ -5,7 +5,7 @@ info:
|
||||
|
||||
http:
|
||||
method: POST
|
||||
url: http://0.0.0.0:8080/api/v1/auth/reset-password
|
||||
url: "{{base_url}}/api/v1/auth/reset-password"
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
|
||||
@@ -5,7 +5,7 @@ info:
|
||||
|
||||
http:
|
||||
method: POST
|
||||
url: http://0.0.0.0:8080/api/v1/auth/verify-email
|
||||
url: "{{base_url}}/api/v1/auth/verify-email"
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
|
||||
@@ -5,7 +5,7 @@ info:
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: http://0.0.0.0:8080/api/v1/dashboard
|
||||
url: "{{base_url}}/api/v1/dashboard"
|
||||
auth:
|
||||
type: bearer
|
||||
token: "{{access_token}}"
|
||||
|
||||
@@ -5,7 +5,7 @@ info:
|
||||
|
||||
http:
|
||||
method: POST
|
||||
url: http://0.0.0.0:8080/api/v1/filaments
|
||||
url: "{{base_url}}/api/v1/filaments"
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
|
||||
@@ -5,7 +5,7 @@ info:
|
||||
|
||||
http:
|
||||
method: DELETE
|
||||
url: http://0.0.0.0:8080/api/v1/filaments/{{filament_id}}
|
||||
url: "{{base_url}}/api/v1/filaments/{{filament_id}}"
|
||||
auth:
|
||||
type: bearer
|
||||
token: "{{access_token}}"
|
||||
|
||||
@@ -5,7 +5,7 @@ info:
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: http://0.0.0.0:8080/api/v1/filaments/{{filament_id}}/label.svg
|
||||
url: "{{base_url}}/api/v1/filaments/{{filament_id}}/label.svg"
|
||||
params:
|
||||
- name: width_mm
|
||||
value: "80"
|
||||
|
||||
@@ -5,7 +5,7 @@ info:
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: http://0.0.0.0:8080/api/v1/filaments/{{filament_id}}
|
||||
url: "{{base_url}}/api/v1/filaments/{{filament_id}}"
|
||||
auth:
|
||||
type: bearer
|
||||
token: "{{access_token}}"
|
||||
|
||||
@@ -5,7 +5,7 @@ info:
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: http://0.0.0.0:8080/api/v1/filaments/{{filament_id}}/qrcode
|
||||
url: "{{base_url}}/api/v1/filaments/{{filament_id}}/qrcode"
|
||||
auth:
|
||||
type: bearer
|
||||
token: "{{access_token}}"
|
||||
|
||||
@@ -5,7 +5,7 @@ info:
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: http://0.0.0.0:8080/api/v1/filaments
|
||||
url: "{{base_url}}/api/v1/filaments"
|
||||
params:
|
||||
- name: page
|
||||
value: "1"
|
||||
|
||||
@@ -5,7 +5,7 @@ info:
|
||||
|
||||
http:
|
||||
method: PUT
|
||||
url: http://0.0.0.0:8080/api/v1/filaments/{{filament_id}}
|
||||
url: "{{base_url}}/api/v1/filaments/{{filament_id}}"
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
|
||||
@@ -5,7 +5,7 @@ info:
|
||||
|
||||
http:
|
||||
method: POST
|
||||
url: http://0.0.0.0:8080/api/v1/spool-presets
|
||||
url: "{{base_url}}/api/v1/spool-presets"
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
|
||||
@@ -5,7 +5,7 @@ info:
|
||||
|
||||
http:
|
||||
method: DELETE
|
||||
url: http://0.0.0.0:8080/api/v1/spool-presets/{{preset_id}}
|
||||
url: "{{base_url}}/api/v1/spool-presets/{{preset_id}}"
|
||||
auth:
|
||||
type: bearer
|
||||
token: "{{access_token}}"
|
||||
|
||||
@@ -5,7 +5,7 @@ info:
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: http://0.0.0.0:8080/api/v1/spool-presets
|
||||
url: "{{base_url}}/api/v1/spool-presets"
|
||||
auth:
|
||||
type: bearer
|
||||
token: "{{access_token}}"
|
||||
|
||||
@@ -5,7 +5,7 @@ info:
|
||||
|
||||
http:
|
||||
method: PUT
|
||||
url: http://0.0.0.0:8080/api/v1/spool-presets/{{preset_id}}
|
||||
url: "{{base_url}}/api/v1/spool-presets/{{preset_id}}"
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
|
||||
@@ -5,7 +5,7 @@ info:
|
||||
|
||||
http:
|
||||
method: GET
|
||||
url: http://0.0.0.0:8080/api/v1/users/me
|
||||
url: "{{base_url}}/api/v1/users/me"
|
||||
auth:
|
||||
type: bearer
|
||||
token: "{{access_token}}"
|
||||
|
||||
@@ -5,7 +5,7 @@ info:
|
||||
|
||||
http:
|
||||
method: PUT
|
||||
url: http://0.0.0.0:8080/api/v1/users/me
|
||||
url: "{{base_url}}/api/v1/users/me"
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
name: route
|
||||
variables:
|
||||
- name: base_url
|
||||
value: https://meowspool.felipecncloud.com
|
||||
- secret: true
|
||||
name: access_token
|
||||
- secret: true
|
||||
name: refresh_token
|
||||
- name: preset_id
|
||||
value: 88eab1b9-e979-46db-940f-59cac97df60b
|
||||
value: 07188f3b-2b74-4251-88bc-037de7628d65
|
||||
- name: filament_id
|
||||
value: da5e431c-bc2e-4075-aa1c-ce82ee9567b4
|
||||
value: ""
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
services:
|
||||
db:
|
||||
image: postgres:16-alpine
|
||||
restart: unless-stopped
|
||||
env_file: .env
|
||||
environment:
|
||||
POSTGRES_USER: ${POSTGRES_USER}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_DB: ${POSTGRES_DB}
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
ports:
|
||||
- "${POSTGRES_PORT:-5432}:5432"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
backend:
|
||||
build:
|
||||
context: ./backend
|
||||
dockerfile: Dockerfile
|
||||
restart: unless-stopped
|
||||
env_file: .env
|
||||
environment:
|
||||
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
|
||||
ports:
|
||||
- "${PORT:-8080}:8080"
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
Reference in New Issue
Block a user