Skip to content

Commit be2f5f4

Browse files
committed
Migrate to Kamal
1 parent 29a80b7 commit be2f5f4

File tree

5 files changed

+38
-16
lines changed

5 files changed

+38
-16
lines changed

.github/workflows/release.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ env:
1616
DOCKER_BUILDKIT: 1
1717
KAMAL_REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
1818
KAMAL_REGISTRY_USERNAME: ${{ github.actor }}
19+
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
20+
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
1921

2022
jobs:
2123
release:
@@ -105,4 +107,4 @@ jobs:
105107
- name: Deploy with Kamal
106108
run: |
107109
kamal lock release -v
108-
kamal deploy -P --version latest
110+
kamal deploy -P --version latest

.kamal/secrets

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
# Option 1: Read secrets from the environment
66
KAMAL_REGISTRY_PASSWORD=$KAMAL_REGISTRY_PASSWORD
77
KAMAL_REGISTRY_USERNAME=$KAMAL_REGISTRY_USERNAME
8+
R2_ACCESS_KEY_ID=$R2_ACCESS_KEY_ID
9+
R2_SECRET_ACCESS_KEY=$R2_SECRET_ACCESS_KEY
810

911
# Option 2: Read secrets via a command
1012
# RAILS_MASTER_KEY=$(cat config/master.key)

CreatorKit/CreatorKit.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</ItemGroup>
1313

1414
<ItemGroup>
15-
<ContainerLabel Include="service" Value="creatorkit" />
15+
<ContainerLabel Include="service" Value="creatorkit.servicestack.net" />
1616
</ItemGroup>
1717

1818
<ItemGroup>

config/deploy.yml

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Name of your application. Used to uniquely configure containers.
2-
service: creatorkit
2+
service: creatorkit.servicestack.net
33

44
# Name of the container image.
5-
image: netcoreapps/creatorkit
5+
image: servicestack/creatorkit
66

77
# Required for use of ASP.NET Core with Kamal-Proxy.
88
env:
@@ -21,7 +21,7 @@ servers:
2121
# in Cloudflare's SSL/TLS setting to "Full" to enable end-to-end encryption.
2222
proxy:
2323
ssl: true
24-
host: creatorkit.netcore.io
24+
host: creatorkit.servicestack.net
2525
# kamal-proxy connects to your container over port 80, use `app_port` to specify a different port.
2626
app_port: 8080
2727

@@ -43,14 +43,14 @@ builder:
4343
volumes:
4444
- "/opt/docker/CreatorKit/App_Data:/app/App_Data"
4545

46-
#accessories:
47-
# litestream:
48-
# roles: ["web"]
49-
# image: litestream/litestream
50-
# files: ["config/litestream.yml:/etc/litestream.yml"]
51-
# volumes: ["/opt/docker/CreatorKit/App_Data:/data"]
52-
# cmd: replicate
53-
# env:
54-
# secret:
55-
# - ACCESS_KEY_ID
56-
# - SECRET_ACCESS_KEY
46+
accessories:
47+
litestream:
48+
roles: ["web"]
49+
image: litestream/litestream
50+
files: ["config/litestream.yml:/etc/litestream.yml"]
51+
volumes: ["/opt/docker/CreatorKit/App_Data:/data"]
52+
cmd: replicate
53+
env:
54+
secret:
55+
- R2_ACCESS_KEY_ID
56+
- R2_SECRET_ACCESS_KEY

config/litestream.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
access-key-id: $R2_ACCESS_KEY_ID
2+
secret-access-key: $R2_SECRET_ACCESS_KEY
3+
4+
dbs:
5+
- path: /data/db.sqlite
6+
replicas:
7+
- type: s3
8+
bucket: creator-kit-prod
9+
path: db.sqlite
10+
region: auto
11+
endpoint: https://b95f38ca3a6ac31ea582cd624e6eb385.r2.cloudflarestorage.com
12+
13+
14+
15+
16+
17+
18+

0 commit comments

Comments
 (0)