Skip to content
Snippets Groups Projects
setup-development.md 10.07 KiB
title: Development setup
sidebarDepth: 3

Setup your development environment

Introduction

Castopod is a web app based on the php framework CodeIgniter 4.

We use Docker quickly setup a dev environment. A docker-compose.yml and Dockerfile are included in the project's root folder to help you kickstart your contribution.

You don't need any prior knowledge of Docker to follow the next steps. However, if you wish to use your own environment, feel free to do so!

Setup instructions

1. Pre-requisites

  1. Install docker.

  2. Clone Castopod project by running:

    git clone https://code.castopod.org/adaures/castopod.git
  3. Create a .env file with the minimum required config to connect the app to the database and use redis as a cache handler:

    CI_ENVIRONMENT="development"
    # If set to development, you must run `npm run dev` to start the static assets server
    vite.environment="development"
    
    # By default, this is set to true in the app config.
    # For development, this must be set to false as it is
    # on a local environment
    app.forceGlobalSecureRequests=false
    
    app.baseURL="http://localhost:8080/"
    app.mediaBaseURL="http://localhost:8080/"
    
    admin.gateway="cp-admin"
    auth.gateway="cp-auth"
    
    database.default.hostname="mariadb"
    database.default.database="castopod"
    database.default.username="castopod"
    database.default.password="castopod"
    
    cache.handler="redis"
    cache.redis.host = "redis"
    
    # You may not want to use redis as your cache handler
    # Comment/remove the two lines above and uncomment
    # the next line for file caching.
    #cache.handler="file"

    NB. You can tweak your environment by setting more environment variables in your custom .env file. See the env for examples or the CodeIgniter4 User Guide for more info.

  4. (for docker desktop) Add the repository you've cloned to docker desktop's Settings > Resources > File Sharing

2. (recommended) Develop inside the app Container with VSCode