Skip to content

Commit d48604b

Browse files
authored
Merge pull request #144 from HAWK-Digital-Environments/feat/Martin/Docker-infrastructure
feat: docker infrastructure
2 parents 4ea026a + d429a21 commit d48604b

File tree

90 files changed

+5786
-38
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+5786
-38
lines changed

.dockerignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/config/model_providers.php
2+
/config/model_providers.php.example
3+
/bin
4+
/node_modules
5+
/vendor
6+
/public/build
7+
/public/hot
8+
/public/storage
9+
/storage/*.key
10+
/storage/logs/laravel.log#
11+
/storage/framework/views/*.php
12+
/storage/app/test_users.json
13+
/.env
14+
/.env.private
15+
/.gitattributes
16+
/.gitignore
17+
/docker-compose*.yml
18+
/hawki
19+
/_documentation
20+
/_docker_production

.env.example

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
# Global Application Settings
2727
# ===========================
2828
#
29+
# - PROJECT_NAME: URL-safe name of the project (everything lowercase, no spaces, no special characters) used to name docker containers.
2930
# - APP_NAME: Application name, can be anything you like
3031
# - APP_ENV: Deployment type: "local", "statiging" or "production"
3132
# - APP_URL: Public URL to access the web interface
@@ -41,6 +42,7 @@
4142
# - AI_MENTION_HANDLE: Hnadle to mention AI in group chats.
4243

4344

45+
PROJECT_NAME=hawki2
4446
APP_NAME= HAWKI2
4547
APP_URL= http://127.0.0.1:8000
4648
APP_ENV= local
@@ -92,7 +94,7 @@ DB_CONNECTION= mysql
9294
#DB_FOREIGN_KEYS= true
9395

9496
## MySQL / MariaDB
95-
#DB_URL=
97+
#DB_URL=
9698
#DB_HOST= localhost
9799
#DB_PORT= 3306
98100
#DB_SOCKET=
@@ -104,7 +106,7 @@ DB_CONNECTION= mysql
104106
#MYSQL_ATTR_SSL_CA=
105107

106108
## Postgresql
107-
#DB_URL=
109+
#DB_URL=
108110
#DB_HOST= localhost
109111
#DB_PORT= 5432
110112
#DB_DATABASE= HAWKI2
@@ -113,7 +115,7 @@ DB_CONNECTION= mysql
113115
#DB_CHARSET= utf8
114116

115117
## Microsoft SQL Server
116-
#DB_URL=
118+
#DB_URL=
117119
#DB_HOST= localhost
118120
#DB_PORT= 1433
119121
#DB_DATABASE= HAWKI2
@@ -145,25 +147,25 @@ FILESYSTEM_DISK= local
145147
# Session Configuration
146148
# ===========================
147149
#
148-
# These are essential Laravel default variables for session management and they must be
150+
# These are essential Laravel default variables for session management and they must be
149151
# present and active to ensure proper session handling within the application.
150152
#
151-
# SESSION_DRIVER: Specifies the session "driver" or handler used to store session data.
152-
# Common choices include "file", "cookie", "database", etc. Typically, "database" is used
153+
# SESSION_DRIVER: Specifies the session "driver" or handler used to store session data.
154+
# Common choices include "file", "cookie", "database", etc. Typically, "database" is used
153155
# if sessions are stored in the database.
154156
#
155-
# SESSION_LIFETIME: The session lifetime in minutes. It determines how long a session
157+
# SESSION_LIFETIME: The session lifetime in minutes. It determines how long a session
156158
# remains active before it expires.
157159
#
158-
# SESSION_ENCRYPT: Indicates whether session data should be encrypted. Accepts "true" or "false".
160+
# SESSION_ENCRYPT: Indicates whether session data should be encrypted. Accepts "true" or "false".
159161
# When set to "true", it adds an extra layer of security by encrypting session data.
160162
#
161163
# SESSION_PATH: Defines the path for which the session cookie is available. The default value is "/".
162164
#
163-
# SESSION_DOMAIN: Specifies the domain that the session cookie is available to. Use "null"
165+
# SESSION_DOMAIN: Specifies the domain that the session cookie is available to. Use "null"
164166
# to default to the current domain.
165167
#
166-
# SESSION_EXPIRE_ON_CLOSE: Defines whether the session should expire when the browser
168+
# SESSION_EXPIRE_ON_CLOSE: Defines whether the session should expire when the browser
167169
# is closed. Set to "true" to expire sessions on browser close, enhancing session security.
168170

169171
SESSION_DRIVER=database
@@ -220,7 +222,7 @@ REVERB_SCHEME = http
220222

221223
REVERB_APP_ID = HAWKI2
222224
REVERB_APP_SECRET = ChangeMe!
223-
REVERB_APP_KEY = ChangeMe!
225+
REVERB_APP_KEY = hawki2
224226

225227
#REVERB_APP_PING_INTERVAL = 60
226228
#REVERB_APP_MAX_MESSAGE_SIZE = 250000
@@ -234,19 +236,19 @@ REVERB_APP_KEY = ChangeMe!
234236
# =================================
235237
#
236238
# These environment variables are used to specify the SSL certificate and the corresponding
237-
# private key that are essential for establishing secure TLS/SSL connections in certain
238-
# broadcasting setups. This is particularly crucial when using Reverb or similar services
239+
# private key that are essential for establishing secure TLS/SSL connections in certain
240+
# broadcasting setups. This is particularly crucial when using Reverb or similar services
239241
# with encrypted connections, ensuring data is securely transmitted over HTTPS.
240242
#
241-
# SSL_CERTIFICATE: Specifies the path to your SSL certificate file. This certificate is used
243+
# SSL_CERTIFICATE: Specifies the path to your SSL certificate file. This certificate is used
242244
# to authenticate and establish a secure connection between the server and the client.
243245
#
244246
# SSL_CERTIFICATE_KEY: Specifies the path to the private key file corresponding to your SSL
245-
# certificate. The key is required to confirm the identity of the server and encrypt the
247+
# certificate. The key is required to confirm the identity of the server and encrypt the
246248
# data being transmitted.
247249
#
248-
# In the broadcasting configuration, these variables are used to configure the Guzzle
249-
# HTTP client with appropriate SSL settings. By providing these files, you enable
250+
# In the broadcasting configuration, these variables are used to configure the Guzzle
251+
# HTTP client with appropriate SSL settings. By providing these files, you enable
250252
# SSL/TLS encryption for broadcast services, enhancing the security of data in transit.
251253

252254
SSL_CERTIFICATE=""
@@ -292,8 +294,8 @@ VITE_REVERB_SCHEME="${REVERB_SCHEME}"
292294
# Queue Worker Configuration
293295
# ===========================
294296
#
295-
# This configuration setting is used to specify the queue connection that should be used by the
296-
# Laravel application. This is essential for managing asynchronous tasks such as sending emails,
297+
# This configuration setting is used to specify the queue connection that should be used by the
298+
# Laravel application. This is essential for managing asynchronous tasks such as sending emails,
297299
# processing uploads, or any other task that can be handled in the background.
298300
#
299301
# QUEUE_CONNECTION: Defines the queue connection that the Laravel application will use.
@@ -467,7 +469,7 @@ ALLOW_USER_TOKEN_CREATION=false
467469
# - DYNAMODB_ENDPOINT: ???
468470

469471
CACHE_STORE = database
470-
CACHE_PREFIX =
472+
CACHE_PREFIX =
471473

472474
## Database Table
473475
#DB_CACHE_TABLE = cache
@@ -500,7 +502,7 @@ MEMCACHED_HOST=127.0.0.1
500502
# cache database table.
501503
#
502504
# - REDIS_CLIENT: PHP library used to access the Redis server
503-
# - REDIS_SERVER: Hostname of the Redis server
505+
# - REDIS_HOST: Hostname of the Redis server
504506
# - REDIS_PORT: Port number of the Redis server
505507
# - REDIS_USERNAME: Username to access the Redis server
506508
# - REDIS_PASSWORD: Password to access the Redis server
@@ -510,14 +512,14 @@ MEMCACHED_HOST=127.0.0.1
510512
# - REDIS_PREFIX: Prefix for database entry keys (by default calculated from the app name)
511513

512514
#REDIS_CLIENT= phpredis
513-
#REDIS_SERVER= localhost
515+
#REDIS_HOST= localhost
514516
#REDIS_PORT= 6379
515517
#REDIS_USERNAME=
516518
#REDIS_PASSWORD=
517519
#REDIS_DB= 0
518520
#REDIS_CACHE_DB= 1
519521
#REDIS_CLUSTER= redis
520-
#REDIS_PREFIX=
522+
#REDIS_PREFIX=
521523

522524

523525
# ========================
@@ -552,11 +554,11 @@ MEMCACHED_HOST=127.0.0.1
552554
# Encryption Configuration
553555
# ==========================
554556
#
555-
# For enhanced security, HAWKI utilizes individual salts for each component to ensure that data is
556-
# encrypted uniquely. While not mandatory, using unique hash keys for each component is recommended
557+
# For enhanced security, HAWKI utilizes individual salts for each component to ensure that data is
558+
# encrypted uniquely. While not mandatory, using unique hash keys for each component is recommended
557559
# to maximize the security of user data, invitations, AI components, passkeys, and backups.
558560
#
559-
# USERDATA_ENCRYPTION_SALT: The salt used specifically for encrypting user data.
561+
# USERDATA_ENCRYPTION_SALT: The salt used specifically for encrypting user data.
560562
# INVITATION_SALT: The salt used for encrypting invitations data.
561563
# AI_CRYPTO_SALT: Used to generate a derived key for the AI messages in the groupchat
562564
# PASSKEY_SALT: The salt used for encrypting passkey data, contributing to robust password and credential security.
@@ -579,5 +581,3 @@ BACKUP_SALT=base64:someLegendarySalt==
579581

580582

581583
IMPRINT_LOCATION = ""
582-
583-
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Publish Docker image
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
branches:
8+
- main
9+
10+
jobs:
11+
push_to_registry:
12+
name: Push Docker image to Docker Hub
13+
runs-on: ubuntu-latest
14+
permissions:
15+
packages: write
16+
contents: read
17+
attestations: write
18+
id-token: write
19+
# Only run this job if a tag is pushed on the main branch
20+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') && github.ref_name == 'main'
21+
steps:
22+
- name: Check out the repo
23+
uses: actions/checkout@v4
24+
25+
- name: Extract tag name
26+
id: tag
27+
shell: bash
28+
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
29+
30+
- name: Set up QEMU
31+
uses: docker/setup-qemu-action@v2
32+
33+
- name: Set up Docker Buildx
34+
uses: docker/setup-buildx-action@v2
35+
36+
- name: Log in to Docker Hub
37+
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
38+
with:
39+
username: ${{ secrets.DOCKER_USERNAME }}
40+
password: ${{ secrets.DOCKER_PASSWORD }}
41+
42+
- name: Extract metadata (tags, labels) for Docker
43+
id: meta
44+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
45+
with:
46+
images: digitalenvironments/hawki
47+
48+
- name: Build and push Docker image
49+
id: push
50+
uses: docker/[email protected]
51+
with:
52+
context: .
53+
file: ./Dockerfile
54+
push: true
55+
target: app_prod
56+
tags: |
57+
digitalenvironments/hawki:latest
58+
digitalenvironments/hawki:${{ steps.tag.outputs.tag }}
59+
60+
- name: Generate artifact attestation
61+
uses: actions/attest-build-provenance@v2
62+
with:
63+
subject-name: index.docker.io/digitalenvironments/hawki
64+
subject-digest: ${{ steps.push.outputs.digest }}
65+
push-to-registry: true

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
/storage/*.key
77
/vendor
88
.env
9+
!/_docker_production/.env
910
.env.backup
11+
.env.private
1012
.env.production
1113
.phpactor.json
1214
.phpunit.result.cache
@@ -19,4 +21,4 @@ yarn-error.log
1921
/.idea
2022
/.vscode
2123
config/model_providers.php
22-
config/model_providers.php
24+
docker-compose.override.yml

0 commit comments

Comments
 (0)