Add Spin to an Existing Project
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.
Install Spin
We have a number of ways to install Spin. Pick any one.
Moving forward, this guide assumes you configured spin
as an alias or installed it locally on your machine.
Initialize Spin
Run this command in the root of your project:
Initialize Spin
spin init
The wizard will ask you some questions and then you'll be on your way to shipping your application.
File Structure
Spin will not overwrite any files. It will only create files that don't exist. If you already have a Dockerfile
, docker-compose.yml
file, etc., it is recommended to make a new branch, delete those files, then run spin init
.
Spin will create the following files & directories:
.infrastructure/
.spin.yml
.spin-inventory.ini
docker-compose.yml
docker-compose.dev.yml
docker-compose.ci.yml
docker-compose.prod.yml
Dockerfile
(sometimes)
Spin will modify the following files:
.gitignore
.dockerignore