├── .cursorrules ├── .github ├── ISSUE_TEMPLATE │ ├── bug.yml │ └── config.yml ├── code_of_conduct.md ├── small-header.png ├── spin-diagram.png └── workflows │ ├── publish-prerelease.yml │ ├── publish-stable-release.yml │ ├── service_publish-node-package.yml │ └── sponsors.yml ├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── SECURITY.md ├── bin └── spin ├── cache └── .gitignore ├── composer.json ├── conf ├── .gitignore └── spin.example.conf ├── docs ├── .env.example ├── .gitignore ├── .npmrc ├── .nvmrc ├── README.md ├── assets │ └── css │ │ ├── animations.css │ │ ├── docsearch.css │ │ ├── hamburger.css │ │ └── tailwind.css ├── components │ ├── Docs │ │ ├── Anchor.vue │ │ ├── Eyebrow.vue │ │ ├── Footer.vue │ │ ├── Header.vue │ │ ├── Logo.vue │ │ ├── ModeToggle.vue │ │ ├── Navigation.vue │ │ ├── NavigationGroup.vue │ │ ├── PageLink.vue │ │ ├── Search.vue │ │ ├── SmallPrint.vue │ │ ├── Tag.vue │ │ └── TopLevelNavItem.vue │ ├── DocumentDrivenNotFound.vue │ ├── Global │ │ ├── MobileMenu.vue │ │ ├── OgImage │ │ │ └── DocsImage.vue │ │ └── ServerSideUp.vue │ ├── Icons │ │ ├── Anchor.vue │ │ ├── Arrow.vue │ │ ├── ChatBubbleIcon.vue │ │ ├── Check.vue │ │ ├── CheckIcon.vue │ │ ├── ClipboardIcon.vue │ │ ├── EnvelopeIcon.vue │ │ ├── Moon.vue │ │ ├── Resource.vue │ │ ├── Search.vue │ │ ├── Social │ │ │ ├── Discord.vue │ │ │ ├── GitHub.vue │ │ │ └── Twitter.vue │ │ ├── Sun.vue │ │ ├── UserIcon.vue │ │ └── UsersIcon.vue │ └── content │ │ ├── AppButton.vue │ │ ├── AppHeading2.vue │ │ ├── AppHeading3.vue │ │ ├── AppHeading4.vue │ │ ├── AppLink.vue │ │ ├── Code │ │ ├── ClipboardIcon.vue │ │ ├── CopyButton.vue │ │ └── PanelHeader.vue │ │ ├── CodeGroup.vue │ │ ├── CodePanel.vue │ │ ├── Column.vue │ │ ├── DiscordIcon.vue │ │ ├── DocsIcon.vue │ │ ├── FeatureGrid.vue │ │ ├── GitHubIcon.vue │ │ ├── GridPattern.vue │ │ ├── Guide.vue │ │ ├── Guides.vue │ │ ├── HeartIcon.vue │ │ ├── HeroPattern.vue │ │ ├── HubMain.vue │ │ ├── InfoIcon.vue │ │ ├── LeadP.vue │ │ ├── MarketingFollowAlong.vue │ │ ├── MarketingGetStarted.vue │ │ ├── MarketingGrid.vue │ │ ├── MarketingHeader.vue │ │ ├── MarketingHero.vue │ │ ├── MarketingServers.vue │ │ ├── MarketingShipFaster.vue │ │ ├── MarketingVideo.vue │ │ ├── NotProse.vue │ │ ├── Note.vue │ │ ├── Properties.vue │ │ ├── Property.vue │ │ ├── Resources.vue │ │ ├── Resources │ │ ├── Pattern.vue │ │ ├── Resource.vue │ │ └── ResourceIcon.vue │ │ ├── ResponsiveImage.vue │ │ ├── Row.vue │ │ ├── Search.vue │ │ └── VideoEmbed.vue ├── composables │ └── states.ts ├── content │ ├── docs │ │ ├── 1.index.md │ │ ├── 1.installation │ │ │ ├── 1.install-macos.md │ │ │ ├── 2.install-windows.md │ │ │ ├── 3.install-linux.md │ │ │ ├── 4.install-composer.md │ │ │ └── 5.install-npm-yarn.md │ │ ├── 11.community │ │ │ ├── 1.get-help.md │ │ │ ├── 2.testing.md │ │ │ └── 3.contributing.md │ │ ├── 2.getting-started │ │ │ ├── 1.how-spin-works.md │ │ │ ├── 2.create-a-new-project-with-spin.md │ │ │ └── 3.add-spin-to-an-existing-project.md │ │ ├── 3.development-environment │ │ │ ├── 1.starting-up-your-development-environment.md │ │ │ └── 2.running-commands-in-development.md │ │ ├── 4.server-configuration │ │ │ ├── 1.server-requirements.md │ │ │ ├── 2.server-configuration-basics.md │ │ │ └── 3.spin-yml-usage.md │ │ ├── 5.providers │ │ │ ├── 0.digitalocean.md │ │ │ ├── 0.hetzner.md │ │ │ ├── 0.vultr.md │ │ │ └── 99.use-any-host.md │ │ ├── 6.deployment │ │ │ ├── 1.choosing-a-deployment-strategy.md │ │ │ ├── 2.automated-deployments-with-github-actions.md │ │ │ └── 3.using-spin-deploy.md │ │ ├── 7.server-access │ │ │ ├── 1.connecting-to-your-server.md │ │ │ ├── 2.troubleshooting-your-application.md │ │ │ └── 3.updating-your-server.md │ │ ├── 8.advanced │ │ │ ├── 2.generating-a-secure-ssh-key.md │ │ │ ├── 3.adding-other-services.md │ │ │ ├── 99.create-your-own-template.md │ │ │ └── migrating-from-spin-v2-to-v3.md │ │ └── 9.command-reference │ │ │ ├── base64.md │ │ │ ├── build.md │ │ │ ├── configure.md │ │ │ ├── debug.md │ │ │ ├── deploy.md │ │ │ ├── down.md │ │ │ ├── exec.md │ │ │ ├── gh.md │ │ │ ├── help.md │ │ │ ├── init.md │ │ │ ├── kill.md │ │ │ ├── latest.md │ │ │ ├── logs.md │ │ │ ├── maintain.md │ │ │ ├── mkpasswd.md │ │ │ ├── new.md │ │ │ ├── provision.md │ │ │ ├── prune.md │ │ │ ├── ps.md │ │ │ ├── pull.md │ │ │ ├── run.md │ │ │ ├── stop.md │ │ │ ├── up.md │ │ │ ├── update.md │ │ │ ├── vault.md │ │ │ └── version.md │ ├── hub.md │ ├── hub │ │ ├── 0.laravel-basic.md │ │ ├── 0.laravel-pro.md │ │ └── 0.nuxt.md │ └── index.md ├── layouts │ ├── docs.vue │ ├── hub.vue │ ├── hubdetail.vue │ └── marketing.vue ├── middleware │ └── directory.ts ├── nuxt.config.ts ├── package.json ├── public │ └── images │ │ ├── docs │ │ ├── community-templates │ │ │ ├── serversideup.png │ │ │ ├── spin-laravel-basic.png │ │ │ ├── spin-laravel-pro.png │ │ │ ├── spin-new-community-template.png │ │ │ └── spin-nuxt.png │ │ ├── digitalocean │ │ │ ├── api-sidebar.png │ │ │ ├── generate-token.png │ │ │ └── token-scopes.png │ │ ├── getting-started │ │ │ └── server-dns.png │ │ ├── github-actions │ │ │ ├── gha-secrets.png │ │ │ ├── github-secrets.png │ │ │ ├── secrets.png │ │ │ └── zero-downtime-deployment.png │ │ ├── hetzner │ │ │ ├── api-token-page.png │ │ │ ├── generate-token.png │ │ │ └── select-project.png │ │ ├── vultr │ │ │ ├── api-link.png │ │ │ ├── api-token.png │ │ │ └── enable-api.png │ │ ├── whats-spin │ │ │ ├── docker-compose-overrides.png │ │ │ ├── docker-overrides-code.png │ │ │ ├── spin-deploy.png │ │ │ ├── spin-diagram.png │ │ │ ├── spin-maintain.png │ │ │ └── spin-provision.png │ │ └── windows │ │ │ ├── docker-accept-eula.png │ │ │ ├── docker-desktop-configuration.png │ │ │ ├── docker-info.png │ │ │ ├── docker-installation-options.png │ │ │ ├── docker-login.png │ │ │ ├── docker-reboot.png │ │ │ ├── docker-run-hello-world.png │ │ │ ├── shell-linux.png │ │ │ ├── shell-windows.png │ │ │ ├── ubuntu-shell.png │ │ │ ├── wsl-configure.png │ │ │ └── wsl-install.png │ │ ├── favicon │ │ ├── android-chrome-192x192.png │ │ ├── android-chrome-512x512.png │ │ ├── apple-touch-icon.png │ │ ├── browserconfig.xml │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon.ico │ │ ├── mstile-150x150.png │ │ ├── safari-pinned-tab.svg │ │ └── site.webmanifest │ │ ├── github-actions.png │ │ ├── icons │ │ ├── heart.svg │ │ └── search-icon.svg │ │ ├── logos │ │ ├── amplitude.svg │ │ ├── server-side-up-footer.svg │ │ ├── server-side-up-logo-horizontal.svg │ │ └── spin-logo.svg │ │ └── social-image.jpg ├── server │ ├── api │ │ └── search.json.get.ts │ └── routes │ │ └── sitemap.xml.ts ├── tailwind.config.js ├── tsconfig.json ├── typography.js └── yarn.lock ├── lib ├── actions │ ├── base64.sh │ ├── build.sh │ ├── configure.sh │ ├── debug.sh │ ├── deploy.sh │ ├── down.sh │ ├── exec.sh │ ├── gh.sh │ ├── help.sh │ ├── init.sh │ ├── kill.sh │ ├── latest.sh │ ├── logs.sh │ ├── maintain.sh │ ├── mkpasswd.sh │ ├── new.sh │ ├── provision.sh │ ├── prune.sh │ ├── ps.sh │ ├── pull.sh │ ├── run.sh │ ├── stop.sh │ ├── up.sh │ ├── update.sh │ ├── vault.sh │ └── version.sh └── functions.sh ├── package.json └── tools ├── install.sh └── upgrade.sh /.cursorrules: -------------------------------------------------------------------------------- 1 | You are an expert in Bash scripting, Docker, and Ansible. You possess deep knowledge of best practices and performance optimizations techniques for writing Bash and Ansible code. 2 | 3 | The project you're working on is called Spin, which is a tool that helps people create new projects, create infrastructure, and maintain existing infrastructure using Docker Compose, Docker Swarm, Ansible, and more. 4 | 5 | Code Style and Structure 6 | - Write clean, maintainable and technically accurate code. 7 | - All bash must be POSIX compliant. 8 | - All bash must be compatible with Linux, WSL2, and MacOS (Bash v3) 9 | - Never use an approach you're not confident about. If you're unsure about something, ask for clarity. 10 | - Always follow best practices for Bash, Ansible, and Docker. 11 | - This project should work on Linux, WSL2, and MacOS without installing any additional dependencies other than Docker. 12 | 13 | This project is open source and the code is available on GitHub, so be sure to follow best practices to make it easy for others to understand, modify, and contribute to the project. 14 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug.yml: -------------------------------------------------------------------------------- 1 | name: "\U0001F41B Bug Report" 2 | description: "You found a bug in the code \U0001F914" 3 | labels: ["Bug: Needs Confirmation 🧐"] 4 | body: 5 | - type: textarea 6 | attributes: 7 | label: Current Behavior 8 | description: A concise description of what you're experiencing. 9 | validations: 10 | required: true 11 | - type: textarea 12 | attributes: 13 | label: Expected Behavior 14 | description: A concise description of what you expected to happen. 15 | validations: 16 | required: true 17 | - type: textarea 18 | attributes: 19 | label: Steps To Reproduce 20 | description: Steps to reproduce the behavior. 21 | placeholder: | 22 | 1. In this environment... 23 | 2. With this config... 24 | 3. Run '...' 25 | 4. See error... 26 | validations: 27 | required: true 28 | - type: textarea 29 | attributes: 30 | label: Environment 31 | description: | 32 | Run `spin debug` and paste your output below. 33 | render: markdown 34 | validations: 35 | required: true 36 | - type: textarea 37 | attributes: 38 | label: Anything else? 39 | description: | 40 | Links? References? Anything that will give us more context about the issue you are encountering! 41 | 42 | Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in. 43 | validations: 44 | required: false -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: ❓ Support Question 4 | url: https://github.com/serversideup/spin/discussions/11 5 | about: Get friendly support from the community on our forum. 6 | 7 | - name: ✨ Request a feature 8 | url: https://github.com/serversideup/spin/discussions/9 9 | about: Learn how to request a new feature. 10 | 11 | - name: 🤵 Get Professional Support & Customizations 12 | url: https://serversideup.net/get-help/?quick_question=spin 13 | about: Skip the line and get priority support directly from the creators of Spin. -------------------------------------------------------------------------------- /.github/small-header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/serversideup/spin/2d8c7f373ad3c760a6e4ed889f756c5ade55ffc7/.github/small-header.png -------------------------------------------------------------------------------- /.github/spin-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/serversideup/spin/2d8c7f373ad3c760a6e4ed889f756c5ade55ffc7/.github/spin-diagram.png -------------------------------------------------------------------------------- /.github/workflows/publish-prerelease.yml: -------------------------------------------------------------------------------- 1 | name: publish-beta 2 | 3 | on: 4 | workflow_dispatch: 5 | release: 6 | types: [prereleased] 7 | 8 | jobs: 9 | publish-prerelease: 10 | uses: ./.github/workflows/service_publish-node-package.yml 11 | with: 12 | release-tag: beta 13 | secrets: inherit -------------------------------------------------------------------------------- /.github/workflows/publish-stable-release.yml: -------------------------------------------------------------------------------- 1 | name: publish-stable 2 | 3 | on: 4 | workflow_dispatch: 5 | release: 6 | types: [released] 7 | 8 | jobs: 9 | publish-stable-release: 10 | uses: ./.github/workflows/service_publish-node-package.yml 11 | with: 12 | release-tag: latest 13 | secrets: inherit -------------------------------------------------------------------------------- /.github/workflows/service_publish-node-package.yml: -------------------------------------------------------------------------------- 1 | on: 2 | workflow_call: 3 | inputs: 4 | runs-on: 5 | required: false 6 | type: string 7 | default: 'ubuntu-22.04' 8 | node-version: 9 | required: false 10 | type: string 11 | default: '18' 12 | release-tag: 13 | required: true 14 | type: string 15 | 16 | jobs: 17 | publish: 18 | runs-on: ${{ inputs.runs-on }} 19 | 20 | steps: 21 | - name: Setup Node.js 22 | uses: actions/setup-node@v3 23 | with: 24 | node-version: ${{ inputs.node-version }} 25 | registry-url: https://registry.npmjs.org/ 26 | 27 | - name: checkout 28 | uses: actions/checkout@v4 29 | 30 | - name: Set NPM version (${{ github.ref_name }}). 31 | run: npm version --git-tag-version=false --commit-hooks=false ${{ github.ref_name }} 32 | 33 | - name: Publish release (${{ inputs.release-tag }}) 34 | run: npm publish --access public --tag ${{ inputs.release-tag }} 35 | env: 36 | NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN_SECRET}} -------------------------------------------------------------------------------- /.github/workflows/sponsors.yml: -------------------------------------------------------------------------------- 1 | name: Generate Sponsors README 2 | on: 3 | workflow_dispatch: 4 | schedule: 5 | - cron: 30 15 * * 0-6 6 | jobs: 7 | deploy: 8 | runs-on: ubuntu-22.04 9 | steps: 10 | - name: Checkout 🛎️ 11 | uses: actions/checkout@v2 12 | 13 | - name: Generate Sponsors 💖 14 | uses: JamesIves/github-sponsors-readme-action@v1 15 | with: 16 | organization: true 17 | maximum: 500 18 | fallback: '
' 19 | token: ${{ secrets.SPONSORS_README_ACTION_PERSONAL_ACCESS_TOKEN }} 20 | marker: 'supporters' 21 | template: '4 | © Copyright {{ copyright }}. All rights reserved. 5 |
6 |7 | {{ description }} 8 |
9 |
10 |
7 | A place to share and build templates together.
8 |
{{ template.description }}
42 |{{ template.author }}
46 |Save thousands. Break free from vendor lock. Replicate your app from development to production. All open source on GitHub.
8 | 9 |Control and own your infrastructure without headaches.
5 | 6 |
7 | 21 | {{ resource.description }} 22 |
23 |11 | 14 |
15 | 16 | ::lead-p 17 | Spin is one of the fastest ways to create a new project and ship to any host of your choice -- all running **100% the exact same configuration across all environments**. Think of Spin as **Laravel Sail, but you can ship your configuration to production**. 18 | :: 19 | 20 | Choose any host, easily provision and maintain your servers, and ship your application with confidence. 21 | 22 | ::feature-grid 23 | :: -------------------------------------------------------------------------------- /docs/content/docs/1.installation/1.install-macos.md: -------------------------------------------------------------------------------- 1 | --- 2 | head.title: 'Install to macOS - Spin by Server Side Up' 3 | title: 'Install to macOS' 4 | description: 'Learn how to install Spin on macOS. No root access required.' 5 | layout: docs 6 | canonical: https://serversideup.net/open-source/spin/docs/installation/install-macos 7 | --- 8 | 9 | # Install to macOS 10 | ::lead-p 11 | Spin easily runs on any macOS machine that runs Docker Desktop. Getting started is as simple as installing Docker Desktop, then running a single command to install `spin`. 12 | :: 13 | 14 | ## Install Docker Desktop 15 | MacOS does not ship with Docker by default. To get Docker installed, you will need "Docker Desktop", which is the official desktop tool developed by Docker. 16 | 17 | [Learn how to install Docker Desktop →](https://docs.docker.com/desktop/mac/install/) 18 | 19 | ## Download and install `spin` 20 | Once Docker is installed, you are now ready to install `spin`. Run the installer with this simple command in your terminal. **No root permissions required.** 21 | 22 | ::code-panel 23 | --- 24 | label: Install spin to your machine (no root permissions required) 25 | --- 26 | ```bash 27 | bash -c "$(curl -fsSL https://raw.githubusercontent.com/serversideup/spin/main/tools/install.sh)" 28 | ``` 29 | :: 30 | 31 | The above script will install spin at the _user_ level in `~/.spin`, using less than 300KB of storage. 32 | 33 | ::note 34 | Spin will prompt you if you want Spin to modify your PATH variable. If you press "Yes" follow the instructions on the screen. If you press "No" you will need to manually add Spin to your PATH. 35 | :: 36 | 37 | 38 | ## Configuring your PATH variable manually 39 | If you did not add `spin` to your PATH during the installation, you can manually add it to your PATH by adding this to your shell profile: 40 | 41 | ::note 42 | Run `echo $0` in your terminal to figure out which shell you are using. 43 | :: 44 | 45 | ::code-panel 46 | --- 47 | label: Add spin to your path 48 | --- 49 | ```bash 50 | # Add this to `~/.zshrc` or `~/.bash_profile` 51 | export PATH="$HOME/.spin/bin:$PATH" 52 | ``` 53 | :: 54 | 55 | In order to apply the changes to your current terminal session, you will need to run the `source` command. 56 | 57 | ::code-panel 58 | --- 59 | label: Use the "source" command to apply your profile changes immediately 60 | --- 61 | ```bash 62 | # If you're using ZSH 63 | source ~/.zshrc 64 | 65 | # If you're using Bash 66 | source ~/.bash_profile 67 | ``` 68 | :: 69 | 70 | ## Validate it's working 71 | You should be able to run this and get a result 🥳 72 | 73 | ::code-panel 74 | --- 75 | label: Confirm spin is working correctly by getting the version 76 | --- 77 | ```bash 78 | spin version 79 | ``` 80 | :: -------------------------------------------------------------------------------- /docs/content/docs/1.installation/4.install-composer.md: -------------------------------------------------------------------------------- 1 | --- 2 | head.title: 'Install via Composer - Spin by Server Side Up' 3 | title: 'Install via Composer' 4 | description: 'Spin can be installed using Composer, a popular PHP package manager. This enables you to make Spin accessible without other developers doing any steps on their end.' 5 | layout: docs 6 | canonical: https://serversideup.net/open-source/spin/docs/installation/install-composer 7 | --- 8 | 9 | # Install via Composer 10 | ::lead-p 11 | Spin can be installed using Composer, a popular PHP package manager. This enables you to make Spin accessible without other developers doing any steps on their end. 12 | :: 13 | 14 | ## Add `spin` to your project with Composer 15 | Installing `spin` at the project level is a great way to deploy `spin` without much configuration from the user's end. [View `spin` on Packagist →](https://packagist.org/packages/serversideup/spin) 16 | 17 | We can use Docker to run `composer` and install it on your project. **Run this command from the parent folder of your project.** 18 | 19 | ::code-panel 20 | --- 21 | label: Install `spin` with Composer 22 | --- 23 | ```bash 24 | docker run --rm -it -v $(pwd):/app composer require serversideup/spin --dev 25 | ``` 26 | :: 27 | 28 | ## Spin is installed 🥳 29 | You should now be able to access `spin` by running: 30 | 31 | ::code-panel 32 | --- 33 | label: Confirm Spin is working 34 | --- 35 | ```bash 36 | bash vendor/bin/spin version 37 | ``` 38 | :: 39 | 40 | ### Bonus Tip: Use an alias 41 | Rather than typing `vendor/bin/spin` every time, you can add a "smart alias", which will check to see if it exists in your `node_modules`, if not, it loads it from the `vendor` folder. 42 | 43 | You can add the following below to your `~/.bash_profile` or your `~/.zshrc`. 44 | 45 | ::code-panel 46 | --- 47 | label: Add to your shell profile (recommended) 48 | --- 49 | ```bash 50 | alias spin='[ -f node_modules/.bin/spin ] && bash node_modules/.bin/spin || bash vendor/bin/spin' 51 | ``` 52 | :: 53 | 54 | You'll now be able to access `spin` from your project root directory. 55 | 56 | ## Initialize Your Project 57 | Once Spin is installed, you can follow the initialization wizard for your project by running `spin init`. 58 | 59 | ::code-panel 60 | --- 61 | label: Initialize Spin with your project 62 | --- 63 | ```bash 64 | spin init 65 | ``` 66 | :: -------------------------------------------------------------------------------- /docs/content/docs/1.installation/5.install-npm-yarn.md: -------------------------------------------------------------------------------- 1 | --- 2 | head.title: 'Install via NPM/Yarn - Spin by Server Side Up' 3 | title: 'Install via NPM/Yarn' 4 | description: 'Spin can be installed using NPM or Yarn, two popular JavaScript package managers. This enables you to make Spin accessible without other developers doing any steps on their end.' 5 | layout: docs 6 | canonical: https://serversideup.net/open-source/spin/docs/installation/install-npm-yarn 7 | --- 8 | 9 | # Install via NPM/Yarn 10 | ::lead-p 11 | Spin can be installed using NPM or Yarn, two popular JavaScript package managers. This enables you to make Spin accessible without other developers doing any steps on their end. 12 | :: 13 | 14 | ## Add `spin` to your project with Yarn/NPM 15 | Installing `spin` at the project level is a great way to deploy `spin` without much configuration from the user's end. [View `spin` on NPM →](https://www.npmjs.com/package/@serversideup/spin) 16 | 17 | We can use Docker to run install `spin` on your project. **Run this command from the parent folder of your project.** 18 | 19 | ::note 20 | The examples below are using `node:latest`. Be sure to change the image name to match your version of Node that you're using for your project. [See available versions →](https://hub.docker.com/_/node/) 21 | :: 22 | 23 | ::code-panel 24 | --- 25 | label: Install `spin` with Yarn + Docker 26 | --- 27 | ```bash 28 | docker run --rm -v $(pwd):/usr/app/src -w /usr/app/src/ node yarn add @serversideup/spin --dev 29 | ``` 30 | :: 31 | 32 | ::code-panel 33 | --- 34 | label: Install `spin` with NPM + Docker 35 | --- 36 | ```bash 37 | docker run --rm -v $(pwd):/usr/app/src -w /usr/app/src/ node npm install @serversideup/spin --dev 38 | ``` 39 | :: 40 | 41 | ## Spin is installed 🥳 42 | You should now be able to access `spin` by running the command below. 43 | 44 | ::code-panel 45 | --- 46 | label: Run `spin` from your project 47 | --- 48 | ```bash 49 | ./node_modules/.bin/spin up 50 | ``` 51 | :: 52 | 53 | ### Bonus Tip: Use an alias 54 | Rather than typing `./node_modules/.bin/spin` every time, you can add a "smart alias", which will check to see if it exists in your `node_modules`, if not, it loads it from the `vendor` folder. 55 | 56 | You can add the following below to your `~/.bash_profile` or your `~/.zshrc`. 57 | 58 | ::code-panel 59 | --- 60 | label: Add to your shell profile (recommended) 61 | --- 62 | ```bash 63 | alias spin='[ -f node_modules/.bin/spin ] && bash node_modules/.bin/spin || bash vendor/bin/spin' 64 | ``` 65 | :: 66 | 67 | You'll now be able to access `spin` from your project root directory. 68 | 69 | ## Initialize Your Project 70 | Once Spin is installed, you can follow the initialization wizard for your project by running `spin init`. 71 | 72 | ::code-panel 73 | --- 74 | label: Initialize Spin with your project 75 | --- 76 | ```bash 77 | spin init 78 | ``` 79 | :: -------------------------------------------------------------------------------- /docs/content/docs/11.community/1.get-help.md: -------------------------------------------------------------------------------- 1 | --- 2 | head.title: 'Get Help - Spin by Server Side Up' 3 | title: 'Get Help' 4 | description: 'Learn how to get help with Spin.' 5 | layout: docs 6 | --- 7 | 8 | # Get Help 9 | ::lead-p 10 | We're huge believers the product is only as good as the community that supports it. We're here to help you get the most out of Spin. 11 | :: 12 | 13 | ## Ensure you're on the latest version 14 | We're always shipping new features and bug fixes for Spin. Ensure you're on the latest release by checking the [releases page](https://github.com/serversideup/spin/releases). 15 | 16 | You can also run `spin update` to ensure you're on the latest version. 17 | 18 | If you're still having issues, sometimes deleting Spin and reinstalling might be a quick fix because it's so easy to delete and reinstall. 19 | 20 | ## Debugging 21 | If you think you've found a bug in Spin, you can get debug logs by setting the `SPIN_DEBUG` environment variable to `true` before running any commands. 22 | 23 | ::code-panel 24 | --- 25 | label: Set SPIN_DEBUG to true 26 | --- 27 | ```bash 28 | SPIN_DEBUG=true spin version 29 | ``` 30 | :: 31 | 32 | This will show you exactly what Spin is running and these debug logs can help the community help you faster. 33 | 34 | ## Going back to the stable release 35 | Going back to the stable release is as easy as deleting the `~/.spin` directory then following the installation instructions to reinstall Spin. 36 | 37 | ::code-panel 38 | --- 39 | label: Delete Spin and reinstall 40 | --- 41 | ```bash 42 | rm -rf ~/.spin 43 | ``` 44 | :: 45 | 46 | Now follow the installation instructions for your operating system: 47 | 48 | - [Install to macOS](/docs/installation/install-macos) 49 | - [Install to Linux](/docs/installation/install-linux) 50 | - [Install to Windows](/docs/installation/install-windows) 51 | 52 | ## Community Support 53 | If you're still having issues, our community primarily uses [GitHub Discussions](https://github.com/serversideup/spin/discussions) and [Discord](https://serversideup.net/discord) to get help with Spin. 54 | 55 | ## Resources 56 | We offer a number of resources to help you get the most out of Spin: 57 | - **[Website](https://serversideup.net/open-source/spin)** overview of the product. 58 | - **[Docs](https://serversideup.net/open-source/spin/docs)** for a deep-dive on how to use the product. 59 | - **[Discord](https://serversideup.net/discord)** for friendly support from the community and the team. 60 | - **[GitHub Repo](https://github.com/serversideup/spin)** for source code, bug reports, and project management. 61 | - **[Get Professional Help](https://serversideup.net/professional-support)** - If you need video + screen-sharing support, we offer that too. 62 | -------------------------------------------------------------------------------- /docs/content/docs/11.community/2.testing.md: -------------------------------------------------------------------------------- 1 | --- 2 | head.title: 'Testing New Releases - Spin by Server Side Up' 3 | title: 'Testing New Releases' 4 | description: 'Learn how to test new releases of Spin.' 5 | layout: docs 6 | --- 7 | 8 | # Testing New Releases 9 | ::lead-p 10 | Spin is a collection of many open source projects built by the Server Side Up community. If you're looking for the latest features, here is how you can help test them out. 11 | :: 12 | 13 | ## Installing latest Spin beta release 14 | Spin is very lightweight and is installed to your `~/.spin` directory by default. If you'd like to install the latest beta, we can easily 15 | 16 | ::code-panel 17 | --- 18 | label: Install latest Spin beta release 19 | --- 20 | ```bash 21 | # Ensure previous installation is removed 22 | rm -rf ~/.spin 23 | 24 | # Install the latest release (regardless of pre-release or stable) 25 | bash -c "$(curl -fsSL https://raw.githubusercontent.com/serversideup/spin/main/tools/install.sh)" "" --beta 26 | ``` 27 | :: 28 | 29 | ## Going back to the stable release 30 | Going back to the stable release is as easy as deleting the `~/.spin` directory then following the installation instructions to reinstall Spin. 31 | 32 | ::code-panel 33 | --- 34 | label: Delete the ~/.spin directory 35 | --- 36 | ```bash 37 | rm -rf ~/.spin 38 | ``` 39 | :: 40 | 41 | Now follow the installation instructions for your operating system: 42 | 43 | - [Install to macOS](/docs/installation/install-macos) 44 | - [Install to Linux](/docs/installation/install-linux) 45 | - [Install to Windows](/docs/installation/install-windows) 46 | 47 | ## Repositories 48 | There are many repositories that are part of the Spin project. Refer to each repository for instructions on how to test the latest changes. 49 | 50 | #### Ansible Collection 51 | - [Spin Ansible Collection](https://github.com/serversideup/ansible-collection-spin) - Used to provision and maintain your production server. 52 | 53 | #### GitHub Actions 54 | - [serversideup/docker-build-action](https://github.com/marketplace/actions/docker-build-action) - A simplified syntax to build and publish your Docker images with GitHub Actions. 55 | - [serversideup/docker-swarm-deploy-github-action](https://github.com/marketplace/actions/docker-swarm-deploy-github-action) - A simplified syntax to deploy to Docker Swarm Mode via GitHub Actions. 56 | 57 | #### Docker Images 58 | - [serversideup/php](https://serversideup.net/open-source/docker-php/) - PHP Docker images highly optimized to work with Laravel + Spin. 59 | - [serversideup/docker-ssh](https://github.com/serversideup/docker-ssh) - A lightweight docker image that runs SSH. This is a fantastic method on using a secure SSH tunnel into your database cluster. 60 | - [serversideup/docker-ansible](https://github.com/serversideup/docker-ansible) - A lightweight docker image that runs Ansible. This allows users to provision their server without needing to know how to install or maintain their Ansible installation. 61 | - [serversideup/docker-github-cli](https://github.com/serversideup/docker-github-cli) - A lightweight docker image that runs GitHub CLI. This allows users to interact with GitHub without needing to install the GitHub CLI on their machine. -------------------------------------------------------------------------------- /docs/content/docs/11.community/3.contributing.md: -------------------------------------------------------------------------------- 1 | --- 2 | head.title: 'Contributing - Spin by Server Side Up' 3 | title: 'Contributing' 4 | description: 'Learn how to contribute to Spin.' 5 | layout: docs 6 | --- 7 | # Contributing 8 | ::lead-p 9 | We're beyond grateful for your interest in contributing to the Spin project. We're always looking for ways to improve the project and we're excited to see what you have to offer. 10 | :: 11 | 12 | ## Before submitting a PR 13 | - Please be intentional and clear in your proposal 14 | - If you're looking to add a new feature, it may be a good idea to open an issue first to discuss the feature 15 | 16 | ## Improving the documentation 17 | All docs are located under `docs/`. In there is a "Nuxt Content" site. Read `docs/README.md` for more information on how to run the docs locally. 18 | 19 | ## Installing a local development copy of Spin 20 | If you'd like to install a copy for development, clone your fork and add this to your shell profile: 21 | 22 | ::code-panel 23 | --- 24 | label: Add an alias to your shell profile 25 | --- 26 | ```bash 27 | export PATH="/path/to/the-project/spin/bin:$PATH" 28 | ``` 29 | :: 30 | 31 | You you point `spin` on to your project, you'll be able to easily test changes before submitting a pull request. 32 | 33 | ## Development dependencies 34 | Other than having a working Docker Desktop or Docker Engine installation -- the only other dependency is running Bash v3 or higher. This means there literally are not any other dependencies to install. 🥳 35 | 36 | ## Installing a specific version of Spin by the branch 37 | The install script allows you to install a specific branch of Spin. This is useful if you want to test a new feature or bug fix before it's released. 38 | 39 | ::note 40 | If the install command is the feature being changed/tested, change the `https://raw.githubusercontent.com/serversideup/spin/main/tools/install.sh` to the branch you're testing. 41 | :: 42 | 43 | ::code-panel 44 | --- 45 | label: Install a test version of Spin 46 | --- 47 | ```bash 48 | BRANCH="release/2.0" bash -c "$(curl -fsSL -H "Cache-Control: no-cache" https://raw.githubusercontent.com/serversideup/spin/main/tools/install.sh)" 49 | ``` 50 | :: 51 | 52 | ::code-panel 53 | --- 54 | label: Testing a local installation script 55 | --- 56 | ```bash 57 | bash -c "$(cat /path/to/the-project/spin/tools/install.sh)" 58 | ``` 59 | :: 60 | 61 | ## Knowing your way around the code 62 | - `bin/spin` - This is the main entry point for the `spin` command. This file is responsible for parsing the arguments and calling the appropriate function. 63 | - `lib/functions.sh` - This file contains all of the functions that are called by `bin/spin`. 64 | - `lib/actions/` - This directory contains all of the actions that are called by `bin/spin`. Each action is a file that contains a function with the same name as the file. For example, `lib/actions/init.sh` contains a function called `init`. This function is called by `bin/spin` when the `init` action is called. -------------------------------------------------------------------------------- /docs/content/docs/2.getting-started/2.create-a-new-project-with-spin.md: -------------------------------------------------------------------------------- 1 | --- 2 | head.title: 'Create a New Project with Spin - Spin by Server Side Up' 3 | title: 'Create a New Project with Spin' 4 | description: 'Learn how to create a new project with Spin.' 5 | layout: docs 6 | --- 7 | 8 | # Create a project with Spin 9 | ::lead-p 10 | Getting up an running with Spin is very easy. It's recommended to install Spin globally so you can easily create new projects. Follow the installation instructions for [macOS](/docs/installation/install-macos/), [Linux](/docs/installation/install-linux), or [Windows](/docs/installation/install-windows) before continuing. We'll walk you through the process of creating a new Laravel project with Spin. 11 | :: 12 | 13 | ## Finding a project on "Spin Hub" 14 | We created a [community hub](/hub) where you can find templates created by the Spin team and the community. We're in the early stages of development, but [anyone can create their own template](/docs/advanced/create-your-own-template) and we will publish it to Spin Hub for you. 15 | 16 | ## Let's create a new Laravel project 17 | For our example, we will use the "Laravel" template from Spin Hub. We have a command called `spin new`, which will take care of the heavy lifting for you 18 | 19 | ::code-panel 20 | --- 21 | label: "Create a new Laravel project called \"my-billion-dollar-idea\"" 22 | --- 23 | ```bash 24 | spin new laravel my-billion-dollar-idea 25 | ``` 26 | :: 27 | 28 | This will create a project in your current directory called `my-billion-dollar-idea`. You can also specify a path to create the project in a different directory. 29 | 30 |31 | 34 |
35 | 36 | Assuming you completed the prerequisites, the onboard wizard will take you through the process so you can get a local development environment with `spin up`. 37 | 38 | ## Starting the development environment 39 | Next, we'll start the development environment with `spin up`. 40 | 41 | [Starting up your Development Environment →](/docs/development-environment/starting-up-your-development-environment) -------------------------------------------------------------------------------- /docs/content/docs/2.getting-started/3.add-spin-to-an-existing-project.md: -------------------------------------------------------------------------------- 1 | --- 2 | head.title: 'Add Spin to an Existing Project - Spin by Server Side Up' 3 | title: 'Add Spin to an Existing Project' 4 | description: 'Learn how to add Spin to an existing project.' 5 | layout: docs 6 | --- 7 | 8 | # Add Spin to an Existing Project 9 | ::lead-p 10 | Adding Spin to an existing project is easy. Everything works through the `spin init` command, we'll ask you a few questions, then you'll be on your way to shipping a 100% replicated application. 11 | :: 12 | 13 | ## Install Spin 14 | We have a number of ways to install Spin. Pick any one. 15 | 16 | - [Install to macOS](/docs/installation/install-macos/) 17 | - [Install to Windows](/docs/installation/install-windows) 18 | - [Install to Linux](/docs/installation/install-linux) 19 | - [Install via Composer](/docs/installation/install-composer) 20 | - [Install via NPM/Yarn](/docs/installation/install-npm-yarn) 21 | 22 | ::note 23 | Moving forward, this guide assumes you configured `spin` as an alias or installed it locally on your machine. 24 | :: 25 | 26 | ## Initialize Spin 27 | Run this command in the root of your project: 28 | 29 | ::code-panel 30 | --- 31 | label: "Initialize Spin" 32 | --- 33 | ```bash 34 | spin init14 | 17 |
18 | 19 | ## Prerequisites 20 | - Docker is installed and running. 21 | - Spin is installed to your system or to your project (via composer or as a node dependency). 22 | 23 | ## Ensure your application dependencies are installed 24 | Before you can bring up your development environment, you need to ensure your application dependencies are installed. 25 | 26 | ::note 27 | If you just ran `spin new` to create a project, the application dependencies will already be installed. You can skip this step. 28 | :: 29 | 30 | ::code-panel 31 | --- 32 | label: Install dependencies (this depends on your project) 33 | --- 34 | ```bash 35 | # PHP dependencies 36 | spin run php composer install 37 | 38 | # Node dependencies 39 | spin run node yarn install 40 | ``` 41 | :: 42 | 43 | ## Bring up your development environment 44 | Once your dependencies are installed, you can bring up your development environment with the following command: 45 | 46 | ::note 47 | Make sure to run this command from your project directory. 48 | :: 49 | 50 | ::code-panel 51 | --- 52 | label: Bring up your development environment 53 | --- 54 | ```bash 55 | spin up 56 | ``` 57 | :: 58 | 59 | ::note 60 | To stop your development environment, press `Ctrl+C`. 61 | :: 62 | 63 | Since Spin is running Docker Compose, you can also pass any argument to the `up` command. For example, `spin up -d` will start your development environment in detached mode. See the full documentation for [spin up](/docs/command-reference/up) for more information. 64 | 65 | ## Accessing your development environment 66 | In order to access your development environment, review the README of the template you're using. Each template has different instructions on how to access the services. 67 | -------------------------------------------------------------------------------- /docs/content/docs/3.development-environment/2.running-commands-in-development.md: -------------------------------------------------------------------------------- 1 | --- 2 | head.title: 'Running Commands in Development - Spin by Server Side Up' 3 | title: 'Running Commands in Development' 4 | description: 'Learn how to run commands in your development environment with Spin.' 5 | layout: docs 6 | canonical: https://serversideup.net/open-source/spin/docs/development-environment/running-commands-in-development 7 | --- 8 | 9 | # Running Commands in Development 10 | ::lead-p 11 | Spin makes it easy to run commands in your development environment by following the Docker Compose CLI syntax. 12 | :: 13 | 14 | ## How to run commands in development 15 | You have two options to run commands in your development environment: 16 | 17 | 1. [`spin exec`](/docs/command-reference/exec) - This executes commands in an EXISTING container (and requires that service to be already running with `spin up`). 18 | 2. [`spin run`](/docs/command-reference/run) - This executes commands in a NEW container, then exits. 19 | 20 | For example, let's say you want to run `composer install` in your development environment for Laravel, you would use the following command: 21 | 22 | ::note 23 | If you have `spin up` running in a terminal window, you will need to run the `spin run` or `spin exec` command in a new terminal window from your project directory. 24 | :: 25 | 26 | ::code-panel 27 | --- 28 | label: Run a command in a new container 29 | --- 30 | ```bash 31 | # Usage: spin run