feat: add Docker support with Dockerfile and docker-compose, update API URLs to use base_url

This commit is contained in:
2026-03-14 20:56:21 -03:00
parent 6a78cb41d8
commit b6e4aa7622
27 changed files with 110 additions and 25 deletions
+5
View File
@@ -0,0 +1,5 @@
target/
.env
.git
.gitignore
*.md
+40
View File
@@ -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: |-
+1 -1
View File
@@ -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: ""