Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 35e23a6
Showing
6 changed files
with
139 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.*.swp | ||
|
||
postgres/ | ||
redis/ | ||
db/ |
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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
FROM composer:2.0 | ||
|
||
WORKDIR /2fauth | ||
|
||
RUN chown 1000:1000 /2fauth | ||
|
||
USER 1000:1000 | ||
|
||
# $(php artisan key:generate) || $(head -c32 /dev/urandom | base64) | ||
# ENV DB_CONNECTION=sqlite | ||
# ENV DB_DATABASE="/2fauth/database/database.sqlite" | ||
|
||
ENV APP_NAME=2FAuth \ | ||
APP_ENV=local \ | ||
APP_DEBUG=false \ | ||
SITE_OWNER=mail@example.com \ | ||
APP_KEY=SomeRandomStringOf32CharsExactly \ | ||
APP_URL=http://localhost \ | ||
IS_DEMO_APP=false \ | ||
LOG_CHANNEL=daily \ | ||
APP_LOG_LEVEL=notice \ | ||
DB_CONNECTION=mysql \ | ||
DB_HOST=127.0.0.1 \ | ||
DB_PORT=3306 \ | ||
DB_DATABASE=homestead \ | ||
DB_USERNAME=homestead \ | ||
DB_PASSWORD=secret \ | ||
CACHE_DRIVER=file \ | ||
SESSION_DRIVER=file \ | ||
MAIL_DRIVER=log \ | ||
MAIL_HOST=smtp.mailtrap.io \ | ||
MAIL_PORT=2525 \ | ||
MAIL_FROM=changeme@example.com \ | ||
MAIL_USERNAME=null \ | ||
MAIL_PASSWORD=null \ | ||
MAIL_ENCRYPTION=null \ | ||
MAIL_FROM_NAME=null \ | ||
MAIL_FROM_ADDRESS=null \ | ||
BROADCAST_DRIVER=log \ | ||
QUEUE_DRIVER=sync \ | ||
SESSION_LIFETIME=12 \ | ||
REDIS_HOST=127.0.0.1 \ | ||
REDIS_PASSWORD=null \ | ||
REDIS_PORT=6379 \ | ||
PUSHER_APP_ID= \ | ||
PUSHER_APP_KEY= \ | ||
PUSHER_APP_SECRET= \ | ||
PUSHER_APP_CLUSTER=mt1 \ | ||
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" \ | ||
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" \ | ||
MIX_ENV=local | ||
|
||
RUN git clone -q https://github.com/Bubka/2FAuth /2fauth | ||
|
||
COPY ./startup.sh . | ||
|
||
RUN composer -q install | ||
|
||
RUN mkdir -p database/ && touch database/database.sqlite | ||
|
||
RUN php artisan config:cache | ||
RUN php artisan storage:link | ||
|
||
ENTRYPOINT ["/2fauth/startup.sh"] |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
all: build | ||
all: up | ||
|
||
build: | ||
docker-compose build | ||
|
||
up: | ||
docker-compose up |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 2FAuth docker | ||
|
||
A repo with project to bring Docker support to [2Fauth](https://github.com/Bubka/2FAuth) |
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
version: '3.6' | ||
|
||
networks: | ||
2fauth-internal: | ||
|
||
services: | ||
2fauth: | ||
image: tommoulard/2fauth | ||
build: . | ||
ports: | ||
- '80:8080' | ||
environment: | ||
- 'SITE_OWNER=tom@moulard.org' | ||
- 'APP_KEY=${APP_KEY}' | ||
- 'REDIS_HOST=2fauth-redis' | ||
- 'DB_CONNECTION=postgres' | ||
- 'DB_HOST=2fauth-postgres' | ||
- 'DB_PORT=5432' | ||
- 'DB_USER=postgres' | ||
- 'DB_NAME=postgres' | ||
- 'DB_PASSWORD=2fauth-postgres-pass' | ||
volumes: | ||
- './2fauth/db/:/2fauth/database/' | ||
networks: | ||
- '2fauth-internal' | ||
|
||
2fauth-redis: | ||
image: redis:6.0-alpine | ||
restart: always | ||
networks: | ||
- '2fauth-internal' | ||
healthcheck: | ||
test: ["CMD", "redis-cli", "ping"] | ||
volumes: | ||
- './2fauth/redis:/data' | ||
|
||
2fauth-postgres: | ||
image: postgres:9.6-alpine | ||
restart: always | ||
user: '1000:1000' | ||
shm_size: 256mb | ||
networks: | ||
- '2fauth-internal' | ||
healthcheck: | ||
test: ["CMD", "pg_isready", "-U", "postgres"] | ||
volumes: | ||
- ./2fauth/postgres:/var/lib/postgresql/data | ||
environment: | ||
- POSTGRES_PASSWORD=2fauth-postgres-pass | ||
|
||
|
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
set -e # exit if fails | ||
|
||
php artisan passport:install | ||
php artisan migrate:refresh | ||
|
||
php -S localhost:80 |