-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Kamal Support for Self deployment #1163
Labels
Comments
Current process to get Kamal working in a brand new sqlite project
service: project_container_name
image: docker_username/repository_name
servers:
web:
- your_web_server
proxy:
ssl: true
host: your_url_on_cloudflare
app_port: 5150
healthcheck:
interval: 3
path: /_health
timeout: 3
registry:
username: docker_username
builder:
dockerfile: dockerfile
# Pass in additional build args needed for your Dockerfile.
# args:
# make sure to remove the file read function
# RUBY_VERSION: Eventually we will have something like this # config/deploy.yml
# Name of your application. Used to uniquely configure containers.
service: project_container_name
# Name of the container image.
image: docker_username/docker_repository
# Deploy to these servers.
servers:
web:
- XXX.XXX.XXX.XXX # VPS ip address
# job:
# hosts:
# - 192.168.0.1
# cmd: bin/jobs
# Enable SSL auto certification via Let's Encrypt and allow for multiple apps on a single web server.
# Remove this section when using multiple web servers and ensure you terminate SSL at your load balancer.
#
# Note: If using Cloudflare, set encryption mode in SSL/TLS setting to "Full" to enable CF-to-app encryption.
proxy:
ssl: true
host: your_domain.com
# Proxy connects to your container on port 80 by default.
app_port: 5150
healthcheck:
interval: 3
path: /_health
timeout: 3
# Credentials for your image host.
registry:
# Specify the registry server, if you're not using Docker Hub
# server: registry.digitalocean.com / ghcr.io / ...
username: docker_username
# Always use an access token rather than real password (pulled from .kamal/secrets).
password:
- KAMAL_REGISTRY_PASSWORD
# Configure builder setup.
builder:
arch: amd64
# Pass in additional build args needed for your Dockerfile.
# args:
dockerfile: dockerfile
# ------- rest of the comments # config/development.yaml
# ------ rest of the config
# Web server configuration
server:
# Port on which the server will listen. the server binding is 0.0.0.0:{PORT}
port: 5150
# The UI hostname or IP address that mailers will point to.
host: http://localhost
# Binding to 0.0.0.0 will allow the server to listen on all available interfaces.
binding: 0.0.0.0
# ------ rest of the config # dockerfile
FROM rust:1.84-slim as builder
WORKDIR /usr/src/
COPY . .
RUN cargo build --release
FROM debian:bookworm-slim
# Install required system dependencies
RUN apt-get update && apt-get install -y \
pkg-config \
libpq-dev \
libssl-dev \
curl \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
# Install sea-orm-cli
RUN cargo install sea-orm-cli
WORKDIR /usr/app
COPY --from=builder /usr/src/assets/static /usr/app/assets/static
COPY --from=builder /usr/src/assets/views /usr/app/assets/views
COPY --from=builder /usr/src/assets/static/404.html /usr/app/assets/static/404.html
COPY --from=builder /usr/src/config /usr/app/config
COPY --from=builder /usr/src/target/release/project_name /usr/app/project_name
ENTRYPOINT ["/usr/app/project_name","start"]
Notes:
I will work on a project with postgres + redis and see how does the setup for those project works |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
The current self-host deployment requires additional setup on the VPS like nginx and more. We can remove this unnecessary barrier via using ROR ecosystem Kamal
Usage
cargo loco generate --kind kamal
kamal setup
The text was updated successfully, but these errors were encountered: