Skip to content

Commit a9a237d

Browse files
authored
Add initial appsvc documentation (#4)
1 parent a8318e4 commit a9a237d

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
title: "Azure App Service"
3+
linkTitle: "Azure App Service"
4+
weight: 16
5+
type: "landing"
6+
draft: false
7+
translated: false
8+
categories:
9+
- wxt
10+
tags:
11+
- appsvc
12+
- docker
13+
---
14+
15+
This page provides an overview for the process of creating a monolith container to deploy to Azure App Service (appsvc). It assumes you already have your project setup to work with the docker-scaffold repository. For initial project setup using docker-scaffold, see the beginning of the container based development workflow here - **[Local Docker setup][docker-setup]**
16+
17+
## Build the appsvc image
18+
19+
```sh
20+
# Make our base docker image
21+
make build
22+
23+
# Build the appsvc image
24+
docker compose -f docker-compose.appsvc.yml up -d
25+
```
26+
27+
> **Note**: After making changes to the project, you will need to remove your base image and build it again. This will ensure all changed files are copied into the base image as needed.
28+
29+
### Delete all Docker images
30+
31+
```sh
32+
docker rmi $(docker images -q) --force
33+
```
34+
35+
## Tag appsvc image and push to Azure Container Registry (ACR)
36+
37+
Now that you have build your appsvc image, you need to tag and push it to the ACR in order to deploy to it App Service.
38+
39+
```sh
40+
docker login MY-CONTAINER-REGISTRY.azurecr.io
41+
docker tag site-XYZ-appsvc:latest MY-CONTAINER-REGISTRY.azurecr.io/site-XYZ-appsvc:[tag]
42+
docker push MY-CONTAINER-REGISTRY.azurecr.io/site-XYZ-appsvc:[tag]
43+
```
44+
45+
Once this is done, you should be able to see your new image in the ACR.
46+
47+
## Build pipeline
48+
49+
In order to automate the build process using Azure DevOps, you can create a pipeline file in the root of your Drupal repo - **[Example pipeline file][pipeline-file]**
50+
51+
This pipeline script will build the appsvc image and push it to your container registry. Make sure you have cretaed the required Service Connection in Azure DevOps (Git repository, ACR).
52+
53+
## Notes
54+
55+
- By default, the appsvc image comes with Varnish and Redis. This can cause issues if your App Service environment is set to Scale Out. This is because Varnish and Redis store cached data in memory, that cannot be mapped to a storage account or another shared resource. This can cause your instances to have different data, and users can see content flip between old and new versions when they refresh their borwser. It is recommended to stay with one instance when using the appsvc cotainer as it comes configured.
56+
57+
<!-- Links Referenced -->
58+
59+
[docker-setup]: https://drupalwxt.github.io/docs/environment/containers
60+
[pipeline-file]: https://gist.github.com/smulvih2/f473295594fe71d117ebc041f6e4b7ef

0 commit comments

Comments
 (0)