Skip to content

Commit 26609be

Browse files
committed
Create Docker publish action
1 parent 66104b4 commit 26609be

File tree

3 files changed

+63
-0
lines changed

3 files changed

+63
-0
lines changed

.github/workflows/publish.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Create and publish a Docker image
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
env:
8+
REGISTRY: ghcr.io
9+
IMAGE_NAME: ${{ github.repository }}
10+
11+
jobs:
12+
build-and-push-image:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Docker Buildx
23+
uses: docker/setup-buildx-action@v3
24+
25+
- name: Log in to the Container registry
26+
uses: docker/login-action@v3
27+
with:
28+
registry: ${{ env.REGISTRY }}
29+
username: ${{ github.actor }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Build and push Docker image
33+
uses: docker/build-push-action@v6
34+
with:
35+
context: .
36+
push: true
37+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

Dockerfile

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM alpine:edge
2+
LABEL Maintainer="BohwaZ <https://bohwaz.net/>" \
3+
Description="oPodSync"
4+
5+
RUN apk --no-cache add php83 php83-ctype php83-opcache php83-session php83-sqlite3
6+
7+
# Setup document root
8+
RUN mkdir -p /var/www
9+
RUN mkdir -p /var/www/server
10+
RUN mkdir -p /var/www/server/data
11+
12+
# Add application
13+
WORKDIR /var/www/
14+
COPY server /var/www/server/
15+
16+
EXPOSE 8080
17+
18+
VOLUME ["/var/www/server/data"]
19+
20+
ENV PHP_CLI_SERVER_WORKERS=2
21+
CMD ["php", "-S", "0.0.0.0:8080", "-t", "server", "server/index.php"]

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,8 @@ GNU AGPLv3
166166
## Author
167167

168168
* [BohwaZ](https://bohwaz.net/)
169+
170+
## Fork
171+
172+
Includes GitHub action to build Docker image.
173+

0 commit comments

Comments
 (0)