Front-end dependencies are not managed by gradle itself. You need to have nodejs and npm installed.
When running gradle assemble or gradle build the copyNpmFiles
will be automatically called.
However running grails run won't do it.
To install the frontend dependencies in the project run: ./gradlew copyNpmFiles
Build the image:
./gradlew assemble && docker image build -t leward/splatoon .Run the app in a container in dev environment:
docker container run -p 8080:8080 -e JAVA_OPTS="-Dgrails.env=development" leward/splatoonIn production environment the database can be configured using environment variables:
[Option 1 - Legacy]
SPLATOON_JDBC_URL- JDBC Connection String, default tomysql://localhost:3306/splatoonSPLATOON_DB_PASSWORD- DB password for thesplatoonuser. Default tosplatoonpassword
[Option 2]
JDBC_DATABASE_URL- JDBC Connection String, default tomysql://localhost:3306/splatoonJDBC_DATABASE_USERNAMEDB username, defaults tosplatoonJDBC_DATABASE_PASSWORDDB password, defaults tosplatoon
Both MySQL and PostgreSQL are supported. Hibernate dialect and JDBC Driver will be picked based on the JDBC URL.
To start a MySQL instance in a Docker container:
docker container run -d \
-p 3306:3306 \
-e MYSQL_ALLOW_EMPTY_PASSWORD=yes \
-e MYSQL_ALLOW_EMPTY_PASSWORD=yes \
-e MYSQL_USER=splatoon \
-e MYSQL_PASSWORD=splatoon \
-e MYSQL_DATABASE=splatoon \
--name splatoon-db \
mysql:5.7;docker container run -d \
-p 5432:5432 \
-e POSTGRES_PASSWORD=splatoon \
-e POSTGRES_USER=splatoon \
-e POSTGRES_DB=splatoon \
--name splatoon-pg-db \
postgres:9.6Uploaded files are stored on AWS S3.
To have the upload feature to work, sepcify the following environment variables:
AWS_ACCESS_KEY_IDAWS_SECRET_KEY
The admin allows to view basic stats from Google Analytics. In order for it to work, a service account has to be configured.
Use the following environment variables ton configure it:
SPLATOON_ANALYTICS_ENABLEDSPLATOON_ANALYTICS_SERVICEACCOUNT_IDSPLATOON_ANALYTICS_SERVICEACCOUNT_JSONKEY
When running with Rancher and SSL over Cloudflare, there may be issues on redirections.
Add the following to the haproxy config in rancher:
backend 80_inkzone_games_
http-request add-header X-Forwarded-Port 443
When in doubt about the backend name, you can check the content of the
/etc/haproxy/haproxy.cfg file to check the config generated by rancher.
The issue is that the default config will add the X-Forwarded-Port 80 which will
be used by grails to make redirects.
Reference: Stackoverflow - Redirect location includes “:80” when X-Forwarded-Proto is https
Run the following command:
./grailsw dev schema-export export
Schema will be generate in the build/ddl.sql file. Be aware that running against the dev profile will generate the
schema using HSQLDB dialect.