-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
2,180 additions
and
941 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
target | ||
|
||
dockerfile | ||
.dockerignore | ||
.git | ||
.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
logger: | ||
enable: true | ||
pretty_backtrace: {{ get_env(name="PRETTY_BACKTRACE", default="false") }} | ||
level: {{ get_env(name="LOG_LEVEL", default="info") }} | ||
format: {{ get_env(name="LOG_FORMAT", default="compact") }} | ||
|
||
server: | ||
port: 3000 | ||
host: 0.0.0.0 | ||
middlewares: | ||
limit_payload: | ||
enable: true | ||
body_limit: 5mb | ||
static: | ||
enable: true | ||
must_exist: true | ||
folder: | ||
uri: "/" | ||
path: "frontend/dist" | ||
fallback: "frontend/dist/index.html" | ||
logger: | ||
enable: true | ||
catch_panic: | ||
enable: true | ||
timeout_request: | ||
enable: true | ||
timeout: 5000 | ||
cors: | ||
enable: true | ||
|
||
workers: | ||
mode: BackgroundQueue | ||
|
||
mailer: | ||
# SMTP mailer configuration. | ||
smtp: | ||
# Enable/Disable smtp mailer. | ||
enable: false | ||
# SMTP server host. e.x localhost, smtp.gmail.com | ||
host: {{ get_env(name="MAILER_HOST", default="localhost") }} | ||
# SMTP server port | ||
port: 1025 | ||
# Use secure connection (SSL/TLS). | ||
secure: false | ||
|
||
database: | ||
uri: {{ get_env(name="DATABASE_URL") }} | ||
enable_logging: {{ get_env(name="DB_LOGGING", default="false") }} | ||
connect_timeout: 500 | ||
idle_timeout: 500 | ||
min_connections: 1 | ||
max_connections: 1 | ||
auto_migrate: true | ||
dangerously_truncate: false | ||
dangerously_recreate: false | ||
|
||
redis: | ||
# Redis connection URI | ||
uri: {{ get_env(name="REDIS_URL", default="redis://127.0.0.1") }} | ||
# Dangerously flush all data in Redis on startup. dangerous operation, make sure that you using this flag only on dev environments or test mode | ||
dangerously_flush: false | ||
|
||
auth: | ||
# JWT authentication | ||
jwt: | ||
# Secret key for token generation and verification | ||
secret: {{ get_env(name="JWT_SECRET") }} | ||
# Token expiration time in seconds | ||
expiration: 604800 # 7 days |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM rust:1.74-slim as builder | ||
|
||
WORKDIR /usr/src/ | ||
|
||
COPY . . | ||
|
||
RUN cargo build --release | ||
|
||
FROM debian:bookworm-slim | ||
|
||
WORKDIR /usr/app | ||
|
||
COPY --from=builder /usr/src/frontend/dist /usr/app/frontend/dist | ||
COPY --from=builder /usr/src/frontend/dist/index.html /usr/app/frontend/dist/index.html | ||
COPY --from=builder /usr/src/config /usr/app/config | ||
COPY --from=builder /usr/src/target/release/liftcalc-cli /usr/app/liftcalc-cli | ||
|
||
ENTRYPOINT ["/usr/app/liftcalc-cli"] | ||
|
||
CMD ["start", "-e", "production"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# fly.toml app configuration file generated for liftcalc-cool-bush-2100 on 2023-12-30T19:14:08-08:00 | ||
# | ||
# See https://fly.io/docs/reference/configuration/ for information about how to use this file. | ||
# | ||
|
||
app = "liftcalc" | ||
primary_region = "sea" | ||
|
||
[build] | ||
|
||
[http_service] | ||
internal_port = 3000 | ||
force_https = true | ||
auto_stop_machines = true | ||
auto_start_machines = true | ||
min_machines_running = 0 | ||
processes = ["app"] | ||
|
||
[checks] | ||
[checks.name_of_your_http_check] | ||
grace_period = "30s" | ||
interval = "15s" | ||
method = "get" | ||
path = "/api/_health" | ||
port = 5500 | ||
timeout = "10s" | ||
type = "http" | ||
|
||
[env] | ||
RAILS_ENV="production" | ||
|
||
[[vm]] | ||
cpu_kind = "shared" | ||
cpus = 1 | ||
memory_mb = 1024 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.