Skip to content

Commit

Permalink
create readme for dockerhub
Browse files Browse the repository at this point in the history
  • Loading branch information
jonocodes committed May 18, 2024
1 parent 7c5afd7 commit 0b95a55
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 6 deletions.
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@

# tag?=latest # default

.PHONY: docker-up
docker-up: ## start docker stack in foreground
docker compose up --build || true # --abort-on-container-exit
docker compose -f docker-compose.dev.yaml up --build || true # --abort-on-container-exit

.PHONY: docker-push
.ONESHELL:
Expand All @@ -12,8 +9,10 @@ docker-push: ## build, tag, and push image to dockerhub. presumes you are logge
@[ "$(tag)" = "" ] && (echo "Tag required. Example tag=1.2.3" ; exit 1)
@image=$${username}/cypht:$(tag)
@echo "Building image $${image}"
@docker buildx build . --platform linux/amd64 -t $${image} -f docker/Dockerfile --push
@docker buildx build . --platform linux/amd64 \
-t $${image} -f docker/Dockerfile --push
# TODO: build for arm architectures
# TODO: push docker/DOCKERHUB-README.md to dockerhub

.PHONY: setup
.ONESHELL:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml → docker-compose.dev.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# this file is used for development, not production
# this file should be used for development, not production

services:
db:
Expand Down
40 changes: 40 additions & 0 deletions docker/DOCKERHUB-README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Cypht

This is the official docker image of [Cypht](https://cypht.org/).

## Features of this image

* Alpine linux based image
* Bundled nginx and PHP 7 provides everything in one image
* Performs same install steps as found on [Cypht install page](https://cypht.org/install.html)
* All Cypht mods and configuration options can be set via environment variables
* Automatic database setup (if configured to use database)

## Example docker-compose

See example file here:
https://github.com/jonocodes/cypht/blob/docker-refresh/docker/docker-compose.yaml

* Starts a database container to be for user authentication
* Starts the Cypht container available on port 80 of the host with ...
* A local volume declared for persisting user settings across container reboots
* An initial user account for authentication
* Environment variables for accessing the database container

*NOTE: Please change usernames and passwords before using this docker-compose in your environment*

## Environment variables

See all the environment variables you can set here:
https://github.com/cypht-org/cypht/blob/master/.env.example

It is recommended that in production you instead make a copy of this file:
```
cp .env.example /etc/cypht-prod.env
```

Make changes to it and source it in to the docker-compose via 'env_file':
```yaml
env_file:
- /etc/cypht-prod.env
```
2 changes: 2 additions & 0 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ services:
image: jonocodes/cypht:2.0.1-docker-wip
ports:
- "80:80"
# env_file:
# - /etc/cypht-prod.env
environment:
- AUTH_USERNAME=admin
- AUTH_PASSWORD=admin
Expand Down

0 comments on commit 0b95a55

Please sign in to comment.