-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix password reset bug * self hosted mode middleware changes on pages * fix lint * wip: self hosted changes * wip: self hosted frontend changes * wip self hosted mode changes * typo correction * remove commented logic * fix env variable names * fix lint issues * fix minor updates * #445 Switched from single monolithic docker image to a docker-compose orchestrated network of services * Automatically configures shared secret * Working through some issues * Use local file storage * Moved the dockerfiles * Fixed some issues when building from clean * Corrected workflow * Hopefully schedules everything correctly now * Prep storage for worker process as well * .env files are required * Pinned dependency versions * Disable self hosted in the client as well * Removed double defaulting logic * Using regexs is more succinct * Added FRONT_URL environment variable * Merge 236e4-self-hosted-mode-changes * Improve inital user setup * Finalized the new docker-compose setup * Fix back-end formatting issues --------- Co-authored-by: Frank <[email protected]> Co-authored-by: Don Benjamin <[email protected]>
- Loading branch information
1 parent
6b13f95
commit 3280e38
Showing
49 changed files
with
9,887 additions
and
7,166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/.git | ||
/Dockerfile | ||
/data | ||
\.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,5 +29,5 @@ public/.DS_Store | |
.env.production | ||
.env.staging | ||
_ide_helper.php | ||
|
||
docker-compose.override.yml | ||
/.make.* |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,8 @@ | |
<a href="https://github.com/JhumanJ/OpnForm/stargazers"><img src="https://img.shields.io/github/stars/JhumanJ/OpnForm" alt="Github Stars"></a> | ||
</a> | ||
<a href="https://github.com/JhumanJ/OpnForm/pulse"><img src="https://img.shields.io/github/commit-activity/m/JhumanJ/OpnForm" alt="Commits per month"></a> | ||
<a href="https://hub.docker.com/r/jhumanj/opnform"> | ||
<img src="https://img.shields.io/docker/pulls/jhumanj/opnform"> | ||
<a href="https://hub.docker.com/r/jhumanj/opnform-api"> | ||
<img src="https://img.shields.io/docker/pulls/jhumanj/opnform-api"> | ||
</a> | ||
<a href="https://github.com/JhumanJ/OpnForm/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-AGPLv3-purple" alt="License"> | ||
<a href="https://github.com/JhumanJ/OpnForm/issues/new"><img src="https://img.shields.io/badge/Report a bug-Github-%231F80C0" alt="Report a bug"></a> | ||
|
@@ -66,94 +66,90 @@ It takes 1 minute to try out the builder for free. You'll have high availability | |
|
||
## Installation | ||
|
||
### Docker Installation 🐳 | ||
|
||
### Docker installation 🐳 | ||
OpnForm can be easily set up using Docker. Pre-built images are available on Docker Hub, which is the recommended method for most users. | ||
|
||
This can be built and run locally but is also hosted publicly on docker hub at `jhumanj/opnform` and is generally best run directly from there. | ||
#### Prerequisites | ||
- Docker | ||
- Docker Compose | ||
|
||
#### Running from docker hub | ||
#### Quick Start | ||
|
||
``` | ||
docker run --name opnform -v $PWD/my-opnform-data:/persist -p 80:80 jhumanj/opnform | ||
``` | ||
|
||
You should now be able to access the application by visiting http://localhost in a web browser. | ||
|
||
> 👀 **Server Deployment**: If you are deploying OpnForm on a server (not locally), then you will [need to use 2 .env files](https://github.com/JhumanJ/opnform?tab=readme-ov-file#using-custom-env-files) to configure the app URLs (`APP_URL` in `.env` and both `NUXT_PUBLIC_APP_URL` & `NUXT_PUBLIC_API_BASE` in `client/.env`). | ||
1. Clone the repository: | ||
``` | ||
git clone https://github.com/JhumanJ/OpnForm.git | ||
cd OpnForm | ||
``` | ||
|
||
2. Set up environment files: | ||
``` | ||
cp .env.docker .env | ||
cp client/.env.docker client/.env | ||
``` | ||
|
||
The `-v` argument creates a local directory called `my-opnform-data` which will store your database and files so that your work is not lost when you restart the container. | ||
3. Start the application: | ||
``` | ||
docker-compose up -d | ||
``` | ||
|
||
The `--name` argument names the running container so that you can refer back to it later, with e.g. `docker stop opnform`. You can use any name you'd like. | ||
4. Access OpnForm at http://localhost | ||
|
||
> 🌐 **Server Deployment Note**: When deploying to a server, configure the app URLs in both `.env` and `client/.env` files. Set `APP_URL` in `.env`, and both `NUXT_PUBLIC_APP_URL` & `NUXT_PUBLIC_API_BASE` in `client/.env`. | ||
#### Using custom .env files | ||
#### Customization | ||
|
||
If you have custom env file you can use them like so: | ||
|
||
Custom Laravel .env file: | ||
``` | ||
docker run --name opnform -v $PWD/custom-laravel-env-file.env:/app/.env -v $PWD/my-opnform-data:/persist -p 80:80 jhumanj/opnform | ||
``` | ||
- **Environment Variables**: Modify `.env` and `client/.env` files to customize your setup. For example, to enable email features, configure a [supported mail driver](https://laravel.com/docs/11.x/mail) in the `.env` file. | ||
|
||
Custom Nuxt .env file: | ||
``` | ||
docker run --name opnform -v $PWD/custom-nuxt-env-file.env:/app/client/.env -v $PWD/my-opnform-data:/persist -p 80:80 jhumanj/opnform | ||
``` | ||
#### Upgrading | ||
|
||
This would load load in the env file located at `my-custom-env-file.env`, note that if you are creating a .env file for use like this it's best to start from the `.env.docker` example file as there are slightly different defaults for the dockerized setup. | ||
1. Check the upgrade instructions for your target version in the documentation. | ||
2. Update your `docker-compose.yml` file if necessary. | ||
3. Apply changes: | ||
``` | ||
docker-compose up -d | ||
``` | ||
|
||
#### Using a custom HTTP port | ||
### Initial Login | ||
|
||
To run on port 8080 | ||
After installation, use these credentials to access the admin panel: | ||
- Email: `[email protected]` | ||
- Password: `password` | ||
|
||
``` | ||
docker run --name opnform -v $PWD/my-opnform-data:/persist -p 8080:80 jhumanj/opnform | ||
``` | ||
⚠️ Change these credentials immediately after your first login. | ||
|
||
#### Building a custom docker image | ||
Note: Public registration is disabled in the self-hosted version. Use the admin account to invite additional users. | ||
|
||
To build a custom docker image from your local source code use this command from the root of the source repository: | ||
### Building from Source | ||
|
||
``` | ||
docker build . -t my-docker-image-name | ||
``` | ||
For development or customization, you can build the Docker images locally: | ||
|
||
This should create a new docker image tagged `my-docker-image-name` which can be run as follows: | ||
1. Build the images: | ||
``` | ||
docker build -t opnform-ui:local -f docker/Dockerfile.client . | ||
docker build -t opnform-api:local -f docker/Dockerfile.api . | ||
``` | ||
|
||
``` | ||
docker run --name opnform -v $PWD/my-opnform-data:/persist -p 80:80 my-docker-image-name | ||
2. Create a docker-compose override file: | ||
``` | ||
cp docker-compose.override.yml.example docker-compose.override.yml | ||
``` | ||
|
||
``` | ||
|
||
#### Upgrading docker installations | ||
|
||
**Please consult the upgrade instructions for the latest opnform version**, e.g. if upgrading from v1 to v2 please check the v2 instructions as the process may change in future releases. | ||
|
||
Normal upgrade procedure would be to stop the running container, back up your data directory (you will need this backup if you want to rollback to the old version) and then start a container running the new image with the same arguments. | ||
|
||
e.g. if you're running from a specific opnform version with | ||
|
||
```docker run --name opnform -v $PWD/my-opnform-data:/persist -p 80:80 jhumanj/opnform:1.0.0``` | ||
|
||
You could run: | ||
|
||
``` | ||
# stop the running container | ||
docker stop opnform | ||
# backup the data directory | ||
cp -r my-opnform-data my-opnform-backup | ||
# start the new container | ||
docker run --name opnform-2 -v $PWD/my-opnform-data:/persist -p 80:80 jhumanj/opnform:2.0.0 | ||
``` | ||
|
||
Then if everything is running smoothly you can delete the old container with: | ||
``` | ||
docker rm opnform | ||
``` | ||
Edit the `docker-compose.override.yml` file to use your locally built images: | ||
```yaml | ||
services: | ||
api: | ||
image: opnform-api:local | ||
ui: | ||
image: opnform-ui:local | ||
``` | ||
If you haven't specified a version e.g. if you are using the image `jhumanj/opnform` or `jhumanj/opnform:latest` you will need to run `docker pull jhumanj/opnform` or `docker pull jhumanj/opnform:latest` before starting the new container. | ||
3. Start the application: | ||
``` | ||
docker-compose up -d | ||
``` | ||
|
||
This method allows you to make changes to the source code and rebuild the images as needed. | ||
|
||
### Using Laravel Valet | ||
This section explains how to get started locally with the project. It's most likely relevant if you're trying to work on the project. | ||
|
Oops, something went wrong.