Add new dockerfile

This commit is contained in:
Nite07 2024-09-17 18:17:20 +08:00
parent 151a8beed4
commit 17476b3625
6 changed files with 76 additions and 28 deletions

View File

@ -0,0 +1,33 @@
name: docker
on:
schedule:
- cron: "0 0 * * 1"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: nite07/standard-notes-frontend:latest
platforms: linux/amd64,linux/arm64,linux/arm/v7
file: ./Dockerfile-standard-notes

View File

@ -30,3 +30,4 @@ jobs:
push: true push: true
tags: nite07/tailscale-derp-docker:latest tags: nite07/tailscale-derp-docker:latest
platforms: linux/amd64,linux/arm64,linux/arm/v7 platforms: linux/amd64,linux/arm64,linux/arm/v7
file: ./Dockerfile-tailscale-derper

12
Dockerfile-standard-notes Normal file
View File

@ -0,0 +1,12 @@
FROM node:16 AS builder
WORKDIR /app
RUN git clone https://github.com/standardnotes/app.git .
RUN yarn install
RUN yarn build:web
FROM nginx:alpine
WORKDIR /usr/share/nginx/html
COPY --from=builder /app/packages/web .
CMD ["nginx", "-g", "daemon off;"]

View File

@ -0,0 +1,28 @@
# Environment Variables
| Name | Description | Default Value |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
| DERP_HOSTNAME | Specifies the domain for the DERP server. | `example.com` |
| DERP_CERTMODE | Determines the SSL/TLS certificate management mode. Options: `manual`, `letsencrypt` | `letsencrypt` |
| DERP_ADDR | Sets the server address and port to bind to. | `:443` |
| DERP_VERIFY_CLIENTS | Whether to verify clients connecting to the DERP server. [reference](https://tailscale.com/kb/1118/custom-derp-servers#optional-restricting-client-access-to-your-derp-node) | `false` |
| DERP_HTTP_PORT | Sets the port for the HTTP server. | `80` |
| DERP_STUN_ENABLE | Whether to enable STUN. | `true` |
| DERP_STUN_PORT | Sets the port for the STUN server. | `3478` |
# Volumes
| Name | Description |
| ---------- | ------------------------------------------------ |
| /app/certs | Directory where SSL/TLS certificates are stored. |
# Usage
```shell
docker run -d --name derper \
-p 80:80 -p 443:443 -p 3478:3478/udp \
-e DERP_DOMAIN=example.com \
nite07/tailscale-derp-docker:latest
```
[Adding DERP servers to your tailnet](https://tailscale.com/kb/1118/custom-derp-servers#step-2-adding-derp-servers-to-your-tailnet)

View File

@ -1,28 +1,2 @@
# Environment Variables - [tailscale derper](./README-tailscale-derper.md)
- standard notes frontend
| Name | Description | Default Value |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
| DERP_HOSTNAME | Specifies the domain for the DERP server. | `example.com` |
| DERP_CERTMODE | Determines the SSL/TLS certificate management mode. Options: `manual`, `letsencrypt` | `letsencrypt` |
| DERP_ADDR | Sets the server address and port to bind to. | `:443` |
| DERP_VERIFY_CLIENTS | Whether to verify clients connecting to the DERP server. [reference](https://tailscale.com/kb/1118/custom-derp-servers#optional-restricting-client-access-to-your-derp-node) | `false` |
| DERP_HTTP_PORT | Sets the port for the HTTP server. | `80` |
| DERP_STUN_ENABLE | Whether to enable STUN. | `true` |
| DERP_STUN_PORT | Sets the port for the STUN server. | `3478` |
# Volumes
| Name | Description |
| ---------- | ------------------------------------------------ |
| /app/certs | Directory where SSL/TLS certificates are stored. |
# Usage
```shell
docker run -d --name derper \
-p 80:80 -p 443:443 -p 3478:3478/udp \
-e DERP_DOMAIN=example.com \
nite07/tailscale-derp-docker:latest
```
[Adding DERP servers to your tailnet](https://tailscale.com/kb/1118/custom-derp-servers#step-2-adding-derp-servers-to-your-tailnet)