Skip to content

Commit 935171b

Browse files
authored
Merge pull request #7 from skvggor/develop
Better CI workflows, add compose.yml information to Caddy
2 parents 811c7ba + 4aae7ba commit 935171b

File tree

6 files changed

+56
-11
lines changed

6 files changed

+56
-11
lines changed

.github/workflows/deploy.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Deploy Production
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
7+
jobs:
8+
deploy:
9+
name: Deploy via SSH
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Run deployment script on remote server
14+
uses: appleboy/ssh-action@v1.2.4
15+
with:
16+
host: ${{ secrets.HOST }}
17+
username: ${{ secrets.USERNAME }}
18+
key: ${{ secrets.SSH_PRIVATE_KEY }}
19+
port: ${{ secrets.PORT || 22 }}
20+
script: |
21+
cd /root/projects/strava-api-wrapper-clojure
22+
23+
git pull origin main
24+
25+
docker compose up -d --force-recreate

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ config.edn
1414
.lsp
1515
.lein-failures
1616
.nrepl-port
17+
compose.yml

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM openjdk:19-jdk-buster
1+
FROM openjdk:27-ea-jdk-trixie
22

33
RUN apt-get update && apt-get install -y curl unzip && rm -rf /var/lib/apt/lists/*
44
RUN curl https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein > /usr/local/bin/lein \

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,35 @@ lein run
4949

5050
The server will start on port 3000 (or the port specified in config.edn).
5151

52+
## Docker Deployment
53+
54+
For production deployment with Docker and Caddy reverse proxy, create a `compose.yml` file:
55+
56+
```yaml
57+
services:
58+
strava-api:
59+
build:
60+
context: .
61+
dockerfile: Dockerfile
62+
restart: unless-stopped
63+
networks:
64+
- caddy_net
65+
labels:
66+
- caddy=your-subdomain.yourdomain.com
67+
- caddy.reverse_proxy={{upstreams 3002}}
68+
- caddy.encode=zstd gzip
69+
expose:
70+
- 3002
71+
volumes:
72+
- ./config.edn:/usr/src/app/config.edn
73+
74+
networks:
75+
caddy_net:
76+
external: true
77+
```
78+
79+
Replace `your-subdomain.yourdomain.com` with your actual domain. Ensure your `config.edn` file is present and properly configured.
80+
5281
## API Endpoints
5382

5483
### Get Total Distance

docker-compose.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)