Skip to content

Instantly share code, notes, and snippets.

@huksley
Last active February 11, 2024 07:21
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huksley/c9707a253570e454bdb9d4d6e74a3017 to your computer and use it in GitHub Desktop.
Save huksley/c9707a253570e454bdb9d4d6e74a3017 to your computer and use it in GitHub Desktop.
Full configuration example for mrsk for NextJS. Save as config/deploy.yml See more at https://github.com/mrsked/mrsk
# yaml-language-server: $schema=https://raw.githubusercontent.com/kjellberg/mrsk/validate-with-json-schema/lib/mrsk/configuration/schema.yaml
service: testexample
image: githubuser/test/main
servers:
web:
hosts:
- 1.1.1.1
labels:
traefik.http.routers.web.rule: Host(`test.example.com`)
traefik.http.routers.web_secure.entrypoints: websecure
traefik.http.routers.web_secure.rule: Host(`test.example.com`)
traefik.http.routers.web_secure.tls: true
traefik.http.routers.web_secure.tls.certresolver: letsencrypt
registry:
server: ghcr.io
username: githubuser
password:
- GHCR_TOKEN
healthcheck:
path: /api/health
accessories:
redis:
image: redis:latest
host: 1.1.1.1
role:
- web
port: "172.17.0.1:6379:6379"
volumes:
- /var/lib/redis:/data
cmd: "--dir /data"
env:
clear:
REDIS_URL: "redis://172.17.0.1:6379"
secret:
- SUPABASE_SERVICE_KEY
ssh:
user: ubuntu
builder:
multiarch: false
traefik:
options:
publish:
# Do not add 80:80, as it added by default
- "443:443"
volume:
- "/tmp/acme.json:/tmp/acme.json"
args:
entryPoints.web.address: ":80"
entryPoints.websecure.address: ":443"
certificatesResolvers.letsencrypt.acme.email: "test@example.com"
certificatesResolvers.letsencrypt.acme.storage: "/tmp/acme.json"
certificatesResolvers.letsencrypt.acme.httpchallenge: true
certificatesResolvers.letsencrypt.acme.httpchallenge.entrypoint: web
memory: 512m
@huksley
Copy link
Author

huksley commented Apr 18, 2023

This is an example for the article I wrote "Deploying NextJS app using Mrsk" https://medium.com/@ruslanfg/deploying-nextjs-using-mrsk-819aa9eb83ba

Checkout mrsk: https://github.com/mrsked/mrsk

@supercobra
Copy link

Thanks for sharing this. Do you know how to specify the ssh key so it's different than the default one?

@huksley
Copy link
Author

huksley commented Aug 1, 2023

@supercobra you can use standard way of ${HOME}/.ssh/config to designate key for specific host(s)
e.g.

Host test1
  HostName 1.1.1.1
  User test1
  IdentityFile ~/.ssh/id_rsa.other

@supercobra
Copy link

Perfect!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment