https://github.com/ganchdev/docker-staytus
Basic docker staytus image with mariadb
https://github.com/ganchdev/docker-staytus
Last synced: 5 months ago
JSON representation
Basic docker staytus image with mariadb
- Host: GitHub
- URL: https://github.com/ganchdev/docker-staytus
- Owner: ganchdev
- Created: 2021-02-07T21:51:49.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-02-08T23:59:03.000Z (over 5 years ago)
- Last Synced: 2025-06-21T04:08:14.479Z (about 1 year ago)
- Language: HTML
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker Staytus
Dockerfile to build [naft-a/staytus](https://github.com/naft-a/staytus), it is based on a `ruby:2.6` image. The quickest way to get staytus up and running with a database (mariadb:latest) is using docker compose.
## Quickstart:
```
git clone git@github.com:naft-a/docker-staytus.git
cd docker-staytus/
nano .env
```
`.env` is the app's config file so we need to make some changes in there before running any containers:
1. Uncomment the `CLEAN_INSTALL=1` variable to apply the staytus db schema to the newly created mariadb database
```
## WARNING! THIS VARIABLE WILL ERASE ALL DATA
## USE FOR NEW STAYTUS INSTALLATIONS ONLY
# CLEAN_INSTALL=1
#############################################
```
2. Populate all other variables inside
```
## Database config ##
DB_NAME=staytus
DB_USER=staytus
DB_PASSWORD=staytus
## SMTP config ##
SMTP_HOSTNAME=
SMTP_PORT=25
SMTP_USERNAME=
SMTP_PASSWORD=
```
3. Run docker compose
```
docker-compose up
```
That's it! Docker will now pull, build and run the required containers, by default docker compose exposes the app on port 3000 so we should be able to see the app on [localhost:3000](http://localhost:3000)
## !!! IMPORTANT !!!
Make sure you comment out the `CLEAN_INSTALL=1` environment variable in the `.env` file before restarting/running a container, otherwise it will erase data in an already installed staytus application.
---
## Alternative installation (without docker compose)
1. Run mariadb container with a volume, change `` with the desired user:
```
docker run --name mariadb -v /home//db_data/:/var/lib/mysql -e MYSQL_USER=staytus -e MYSQL_PASSWORD=staytus -e MYSQL_DATABASE=staytus -e MYSQL_ROOT_PASSWORD=password -d mariadb:latest
```
2. Build & run staytus container
```
cd docker-staytus/
# Build the image
docker build -t username/staytus:latest .
# Run a container
docker run -it --link mariadb:db -p 3000:8787 -e CLEAN_INSTALL=1 -e DB_ADAPTER=mysql2 -e DB_HOST=db -e DB_POOL=5 -e DB_USER=staytus -e DB_PASSWORD=staytus -e DB_DATABASE=staytus username/staytus:latest
```
## Other features
This project supports themes when built with docker compose. The default theme is located in `content/themes/default/`, if you wish to add your custom styles or scripts, simply make the changes and re-run the container
It also supports Internationalization (I18n)
In `content/locales/`, add a new file with a locale identifier:
```
touch bg.yml
```
Add all locale definitions and use the localized string in the .erb views:
```
<%= t('themes.default.hello', locale: :bg) %>
```