File tree 2 files changed +22
-19
lines changed
2 files changed +22
-19
lines changed Original file line number Diff line number Diff line change 9
9
jobs :
10
10
build :
11
11
runs-on : self-hosted
12
+ concurrency :
13
+ group : ${{ github.workflow }}-${{ github.ref }}
14
+ cancel-in-progress : true
12
15
13
16
steps :
14
17
- uses : actions/checkout@v4
15
18
19
+ - name : Cache Docker layers
20
+ uses : actions/cache@v3
21
+ with :
22
+ path : /tmp/.buildx-cache
23
+ key : ${{ runner.os }}-docker-${{ github.sha }}
24
+ restore-keys : |
25
+ ${{ runner.os }}-docker-
26
+
16
27
- name : Create PostgreSQL data directory
17
28
run : |
18
29
sudo mkdir -p /root/mydata/postgresql-data
22
33
run : sudo docker compose down || true
23
34
24
35
- name : Build and start Docker containers
25
- run : sudo docker compose up -d --build
36
+ run : sudo docker compose up -d --build --cache-from type=local,src=/tmp/.buildx-cache --cache-to type=local,dest=/tmp/.buildx-cache
Original file line number Diff line number Diff line change 1
1
services :
2
- # caddy:
3
- # image: caddy:latest
4
- # restart: unless-stopped
5
- # ports:
6
- # - "80:80"
7
- # - "443:443"
8
- # - "443:443/udp"
9
- # volumes:
10
- # - ./Caddyfile:/etc/caddy/Caddyfile
11
- # - ./site:/srv
12
- # - caddy_data:/data
13
- # - caddy_config:/config
14
-
15
2
app :
16
3
build : .
17
4
ports :
@@ -20,6 +7,11 @@ services:
20
7
- db
21
8
environment :
22
9
- DATABASE_URL=postgresql://user:password@db:5432/database
10
+ deploy :
11
+ resources :
12
+ limits :
13
+ cpus : " 0.5"
14
+ memory : " 256M"
23
15
24
16
db :
25
17
image : postgres
@@ -29,8 +21,8 @@ services:
29
21
- POSTGRES_DB=database
30
22
volumes :
31
23
- /root/mydata/postgresql-data:/var/lib/postgresql/data
32
- # volumes :
33
- # caddy_data :
34
- # driver: local
35
- # caddy_config:
36
- # driver: local
24
+ deploy :
25
+ resources :
26
+ limits :
27
+ cpus : " 0.25 "
28
+ memory : " 512M "
You can’t perform that action at this time.
0 commit comments