@@ -75,8 +75,6 @@ This command already creates a `Dockerfile` and `.dockerignore` for you, so you
75
75
create folder ` deploy ` and create file ` compose.yml ` inside:
76
76
77
77
``` yml title="deploy/compose.yml"
78
-
79
-
80
78
services :
81
79
traefik :
82
80
image : " traefik:v2.5"
@@ -90,15 +88,20 @@ services:
90
88
- " /var/run/docker.sock:/var/run/docker.sock:ro"
91
89
92
90
myadmin :
93
- image : localhost:5000/myadmin:latest
91
+ image : ${MYADMIN_REPO}:latest
92
+ build :
93
+ context : ../adminforth-app
94
+ tags :
95
+ - ${MYADMIN_REPO}:latest
96
+ cache_from :
97
+ - type=registry,ref=${MYADMIN_REPO}:cache
98
+ cache_to :
99
+ - type=registry,ref=${MYADMIN_REPO}:cache,mode=max,compression=zstd,image-manifest=true,oci-mediatypes=true
100
+
94
101
pull_policy : always
95
102
restart : always
96
103
env_file :
97
104
- .env.secrets.prod
98
- environment :
99
- - NODE_ENV=production
100
- - DATABASE_URL=sqlite://.db.sqlite
101
- - PRISMA_DATABASE_URL=file:.db.sqlite
102
105
103
106
volumes :
104
107
- myadmin-db:/code/db
@@ -148,29 +151,16 @@ tfplan
148
151
.env.secrets.prod
149
152
` ` `
150
153
151
- # # Step 6 - buildx bake file
152
-
153
- Create file `deploy/docker-bake.hcl` :
154
-
155
- ` ` ` hcl title="deploy/docker-bake.hcl"
156
- variable "REGISTRY_BASE" {
157
- default = "appserver.local:5000"
158
- }
154
+ # # Step 6 - file with secrets for local deploy
159
155
160
- group "default" {
161
- targets = ["myadmin"]
162
- }
156
+ Create file `deploy/.env.secrets.prod`
163
157
164
- target "myadmin" {
165
- context = "../myadmin"
166
- tags = ["${REGISTRY_BASE}/myadmin:latest"]
167
- cache-from = ["type=registry,ref=${REGISTRY_BASE}/myadmin:cache"]
168
- cache-to = ["type=registry,ref=${REGISTRY_BASE}/myadmin:cache,mode=max,compression=zstd"]
169
- push = true
170
- }
158
+ ` ` ` bash
159
+ ADMINFORTH_SECRET=<your_secret>
171
160
` ` `
172
161
173
162
163
+
174
164
# # Step 7 - main terraform file main.tf
175
165
176
166
First of all install Terraform as described here [terraform installation](https://developer.hashicorp.com/terraform/install#linux).
0 commit comments