- Docker 17 ce or later
- Docker Compose 1.16 or later
$ git clone git@github.com:webdino/gitfab2.git
$ cd gitfab2
$ cp .env.sample .env
$ docker-compose build
- Open in your VSCode
- Open "Command Palette" (Ctrl + Shift + P)
- Select "Dev Containers: Reopen in Container"
$ docker-compose up
$ docker-compose ps
Name Command State Ports
--------------------------------------------------------------------------------------
gitfab2_app_1 prehook ruby -v bundle ins ... Up 0.0.0.0:3000->3000/tcp
gitfab2_db_1 docker-entrypoint.sh --inn ... Up (healthy) 3306/tcp
Open https://localhost:3000 in your browser.
$ docker-compose run app bundle exec rails db:setup
$ docker-compose run app bundle exec rails db:test:prepare
$ docker-compose run app bundle exec rspec
Midify and run
$ vi config/Dockerfile.prod
$ docker build -t gitfab2 -f docker/Dockerfile.prod .
$ docker run -p 3000:3000 -e SECRET_KEY_BASE=xxxxxxxxxx gitfab2
$ ssh-keygen -t ed25519
$ vi ~/.ssh/config
$ ssh gitfab2.host
Host gitfab2.host
HostName 123.456.789.012
User deploy
Port 22
IdentitiesOnly yes
IdentityFile ~/.ssh/fabble2024.deploy.id_ed25519
https://kamal-deploy.org/docs/installation/
if [[ -f ~/.bashrc ]] ; then
. ~/.bashrc
fi
if [ -z "$SSH_AUTH_SOCK" ]; then
# Check for a currently running instance of the agent
RUNNING_AGENT="`ps -ax | grep 'ssh-agent -s' | grep -v grep | wc -l | tr -d '[:space:]'`"
if [ "$RUNNING_AGENT" = "0" ]; then
# Launch a new instance of the agent
ssh-agent -s &> $HOME/.ssh/ssh-agent
fi
eval `cat $HOME/.ssh/ssh-agent`
fi
ssh-add $HOME/.ssh/deploy.id_ed25519
alias kamal='docker run -it --rm -v "${PWD}:/workdir" -v "${SSH_AUTH_SOCK}:/ssh-agent" -v /var/run/docker.sock:/var/run/docker.sock -e "SSH_AUTH_SOCK=/ssh-agent" ghcr.io/basecamp/kamal:latest'
$ kamal deploy
gitfab2 is released under the Apache License, Version 2.0.
Copyright 2017 WebDINO Japan.