Initial import
This commit is contained in:
commit
164e8b9985
|
@ -0,0 +1,17 @@
|
|||
TYPE=levelfly
|
||||
|
||||
DOMAIN=levelfly.example.com
|
||||
## Domain aliases
|
||||
#EXTRA_DOMAINS=', `www.levelfly.example.com`'
|
||||
LETS_ENCRYPT_ENV=production
|
||||
|
||||
AWS_ACCESS_KEY_ID=ADD_ME
|
||||
AWS_SECRET_ACCESS_KEY=ADD_ME
|
||||
MANDRILL_APIKEY=ADD_ME
|
||||
MANDRILL_USERNAME=email@example.com
|
||||
PUSHER_SOCKET_URL=ws://ws.pusherapp.com/app/APP_ID
|
||||
PUSHER_URL=https://USER:PASS@api.pusherapp.com/apps/APP
|
||||
S3_KEY=ADD_ME
|
||||
S3_PATH=example.s3.amazonaws.com/example
|
||||
S3_SECRET=ADD_ME
|
||||
SUPPORT_EMAIL=test@example.com
|
|
@ -0,0 +1,28 @@
|
|||
# levelfly
|
||||
|
||||
${REPO_DESCRIPTION}
|
||||
|
||||
<!-- metadata -->
|
||||
* **Category**:
|
||||
* **Status**:
|
||||
* **Image**: [`levelfly`](https://hub.docker.com/r/levelfly/levelfly)
|
||||
* **Healthcheck**:
|
||||
* **Backups**:
|
||||
* **Email**:
|
||||
* **Tests**:
|
||||
* **SSO**:
|
||||
<!-- endmetadata -->
|
||||
|
||||
## Basic usage
|
||||
|
||||
1. Set up Docker Swarm and [`abra`]
|
||||
2. Deploy [`coop-cloud/traefik`]
|
||||
3. `abra app new levelfly --secrets` (optionally with `--pass` if you'd like
|
||||
to save secrets in `pass`)
|
||||
4. `abra app YOURAPPDOMAIN config` - be sure to change `$DOMAIN` to something that resolves to
|
||||
your Docker swarm box
|
||||
5. `abra app YOURAPPDOMAIN deploy`
|
||||
6. Open the configured domain in your browser to finish set-up
|
||||
|
||||
[`abra`]: https://git.autonomic.zone/autonomic-cooperative/abra
|
||||
[`coop-cloud/traefik`]: https://git.autonomic.zone/coop-cloud/traefik
|
|
@ -0,0 +1,88 @@
|
|||
---
|
||||
version: "3.8"
|
||||
|
||||
x-environment:
|
||||
&default-env
|
||||
- DB_USER=levelfly
|
||||
- DB_NAME=levelfly
|
||||
- DB_PASSWORD=test
|
||||
- DB_HOST=db
|
||||
- APP_ENV=production
|
||||
- APP_NAME=levelfly
|
||||
- AWS_ACCESS_KEY_ID
|
||||
- AWS_SECRET_ACCESS_KEY
|
||||
- BUNDLE_WITHOUT=development:test
|
||||
- LANG=en_US.UTF-8
|
||||
- LOG_LEVEL=info
|
||||
- DOMAIN
|
||||
- MAIL_DOMAIN
|
||||
- MANDRILL_APIKEY
|
||||
- MANDRILL_USERNAME
|
||||
- NEW_RELIC_LOG=stdout
|
||||
- PUSHER_SOCKET_URL
|
||||
- PUSHER_URL
|
||||
- RACK_ENV=production
|
||||
- RAILS_ENV=production
|
||||
- S3_KEY
|
||||
- S3_PATH
|
||||
- S3_PROTOCOL=https
|
||||
- S3_SECRET
|
||||
- SUPPORT_EMAIL
|
||||
- URL=https://$DOMAIN
|
||||
- MAILER_DEFAULT_URL=$DOMAIN
|
||||
- RAILS_LOG_TO_STDOUT=true
|
||||
- RAILS_SERVE_STATIC_FILES=true
|
||||
|
||||
services:
|
||||
app:
|
||||
image: neuronicgames/levelfly
|
||||
environment: *default-env
|
||||
depends_on:
|
||||
- db
|
||||
networks:
|
||||
- proxy
|
||||
- internal
|
||||
ports:
|
||||
- 3000:3000
|
||||
deploy:
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=3000"
|
||||
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
|
||||
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
|
||||
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
||||
## Redirect from EXTRA_DOMAINS to DOMAIN
|
||||
#- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
|
||||
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
|
||||
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
|
||||
jobs:
|
||||
image: neuronicgames/levelfly
|
||||
command: bundle exec rake jobs:work
|
||||
environment: *default-env
|
||||
depends_on:
|
||||
- app
|
||||
- db
|
||||
networks:
|
||||
- internal
|
||||
db:
|
||||
image: postgres:9.6-alpine
|
||||
environment:
|
||||
POSTGRES_DB: levelfly
|
||||
POSTGRES_USER: levelfly
|
||||
POSTGRES_PASSWORD: test
|
||||
networks:
|
||||
- internal
|
||||
healthcheck:
|
||||
test: ["CMD", "pg_isready", "-U", "levelfly"]
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
|
||||
networks:
|
||||
internal:
|
||||
proxy:
|
||||
external: true
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
Reference in New Issue