07e427c (parent 05226df 3f302f3)12/18/2023, 3:07:37 AM
.md
Markdown
(text/x-gfm)
# ❇️ GitFOSS

GitFOSS is a small and simple, free and open-source Git Forge
built w/ Node.JS, Fastify, Prisma and React!

## Run it

In order to run your own instance of GitFOSS, the first step is to clone this
git repository and cd into it:

```sh
$ git clone https://gitfoss.io/ethicdevs/gitfoss.git
$ cd gitfoss/
```

### Locally via Node/Yarn

#### Development mode

Make sure your `.env.local` file is correctly setup and includes all the environment
variables present in the example `.env` file. Make sure no value is set to `fake`.

```sh
$ yarn dev # Run dev 'server'
$ yarn typecheck # Check TypeScript types validity
$ yarn test # Run app tests
```

Also when performing changes to the Prisma schema, don't forget to make a new
migration files using the following command:

```sh
$ yarn migrate:dev # Create a new migration file interactively
```

#### Production-like mode

Make sure your `.env.production` file is correctly setup and includes all the environment
variables present in the example `.env` file. Make sure no value is set to `fake`.

```sh
$ yarn build
$ cp .env.production dist/.env.production
$ DATABASE_URL='postgresql://...from.env.production...' yarn migrate:deploy
$ yarn start
```

### Using Docker

```sh
$ docker run -p 1337:1337 \
  -e COOKIE_NAME='gitfoss_ssid' \
  -e COOKIE_SECRET='change_me_cookie_secret' \
  -e DATABASE_URL='postgresql://...from.env.production...' \
  -e DEPLOYMENT_DOMAIN='local-app.localhost' \
  -e DEPLOYMENT_SCHEME='http' \
  -e GIT_REPOSITORIES_ROOT='/var/lib/gitfoss/repos' \
  docker.io/library/gitfoss_web:latest

# Get the container id then run migrations
$ docker exec -it <container_id_here> yarn migrate:deploy
```

### Using docker-compose

```sh
$ docker-compose up -d
$ docker-compose exec web yarn migrate:deploy
$ docker-compose exec traefik cat /var/log/traefik/traefik.log
```

## License

This project is licensed under the [MIT](LICENSE) license.

GitFOSS - v0.2.0 (#48b426e) - MIT License