Skip to content

Commit

Permalink
Merge new consumet repo
Browse files Browse the repository at this point in the history
  • Loading branch information
eatmynerds committed Mar 10, 2024
1 parent 7fe679e commit ee63374
Show file tree
Hide file tree
Showing 16 changed files with 1,167 additions and 374 deletions.
58 changes: 58 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

name: 🐞 Bug report
description: Create a report to help us improve
labels: [bug]
body:
- type: input
id: describe-the-bug
attributes:
label: Describe the bug
description: |
A clear and concise description of what the bug is.
placeholder: |
Example: "This provider is not working..."
validations:
required: true

- type: textarea
id: reproduce-steps
attributes:
label: Steps to reproduce
description: Provide an example of the issue.
placeholder: |
Example:
1. First step
2. Second step
3. Issue here
validations:
required: true

- type: textarea
id: expected-behavior
attributes:
label: Expected behavior
placeholder: |
Example:
"This should happen..."
validations:
required: true

- type: textarea
id: actual-behavior
attributes:
label: Actual behavior
placeholder: |
Example:
"This happened instead..."
validations:
required: true

- type: textarea
id: additional-context
attributes:
label: Additional context
description: |
Add any other context about the problem here.
placeholder: |
Example:
"Also ..."
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
contact_links:
- name: 🍕 Provider Request
url: https://github.com/consumet/extensions/issues/new?assignees=&labels=provider+request&template=provider-request.yml
about: Request a new provider

- name: 🙋 Question
url: https://discord.gg/qTPfvMxzNH
about: Ask your question or suggestion in Discord server

- name: 🍔 Providers list
url: https://consumet.org/extensions/list/
about: A list of the available providers
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# will have compiled files and executables
debug/
target/
build/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Expand Down
16 changes: 11 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
[package]
name = "consumet-api"
version = "0.1.0"
version = "0.0.1"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
axum = { version = "0.6.19", features = ["macros"] }
consumet-api-rs = "0.2.2"
axum = { version = "0.7", features = ["macros", "http2", "json"] }
consumet = "0.0.11"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.68"
tokio = { version = "1.0", features = ["full"] }
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
dotenv = "0.15.0"
tracing-subscriber = { version = "0.3.18", default-features = false, features = [ "env-filter", "fmt", "json" ] }
time = { version = "0.3", features = [ "formatting" ] }
tower = "0.4.13"
tracing = "0.1.37"
openssl = { version = "0.10.62", features = ["vendored"] }
anyhow = "1.0.79"
humantime-serde = "1.1.1"
tower-http = { version = "0.5", features = [ "trace" ] }
dotenv = "0.15.0"
tracing-log = "0.2.0"
47 changes: 34 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,42 @@
# Use the official Rust image as the base image
FROM rust:latest
FROM rust:latest AS builder

# Set the working directory inside the container
WORKDIR /usr/src/consumet-api
LABEL version="1.0.0"
LABEL description="Consumet API (Axum) Docker Image"

ARG PORT=3000
ENV PORT=${PORT}

WORKDIR /app

# Copy the Rust application's source code into the container
COPY . .

RUN rustup default nightly
RUN \
--mount=type=cache,target=/app/target/ \
--mount=type=cache,target=/usr/local/cargo/registry/ \
cargo build --release && \
cp ./target/release/consumet-api /

FROM debian:bookworm-slim AS final

RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
--uid "10001" \
appuser

COPY --from=builder /consumet-api /usr/local/bin

RUN chown appuser /usr/local/bin/consumet-api

USER appuser

ENV PORT=8080
WORKDIR /usr/local/bin

# Build the Rust application inside the container
RUN cargo build --release
ENV RUST_LOG=INFO

# Expose any necessary ports (if your app requires it)
EXPOSE 8080
EXPOSE ${PORT}

# Specify the command to run your application (modify as needed)
CMD ["./target/release/consumet-api"]
ENTRYPOINT ["consumet-api"]
Loading

0 comments on commit ee63374

Please sign in to comment.