Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredLunde committed Dec 29, 2024
1 parent e154b1f commit b91a557
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 12 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
- "*"
branches:
- main
paths:
- "**/*.go"
- "**/Dockerfile"
- "go.mod"
- "go.sum"

permissions:
contents: write
Expand Down Expand Up @@ -50,6 +55,6 @@ jobs:
TARGETARCH=${{ matrix.platform }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
platforms: linux/amd64,linux/arm64,linux/arm64/v8
cache-from: type=gha
cache-to: type=gha,mode=max
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
ARG VERSION=1.23.1
ARG BUILDPLATFORM=linux/amd64
ARG BUILDPLATFORM
ARG BUILDER=docker.io/library/golang

FROM --platform=${BUILDPLATFORM} ${BUILDER}:${VERSION} AS base
Expand Down Expand Up @@ -51,11 +51,11 @@ RUN cd /tmp && \

FROM vips-builder AS build
WORKDIR /go/src/app
ARG TARGETOS=linux
ARG TARGETARCH=amd64
ARG TARGETOS
ARG TARGETARCH

COPY . .
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -trimpath -ldflags="-s -w" -o /go/bin/app ./cmd/server
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} CGO_ENABLED=1 go build -trimpath -ldflags="-s -w" -o /go/bin/app ./cmd/server

FROM debian:stable-slim
WORKDIR /app
Expand Down
34 changes: 27 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,33 @@ The service can be configured by setting the environment variables below.

### Server configuration

| Environment Variable | Description | Default |
| ---------------------- | ------------------------------------------------------------------------------------------- | ------- |
| `HOST` | The host the server listens on | `[::]` |
| `PORT` | The port the server listens on | `3000` |
| `REQUEST_TIMEOUT` | The timeout for requests formatted as a Go duration | `30s` |
| `CORS_ALLOWED_ORIGINS` | A comma-separated list of allowed origins for CORS requests, e.g. `https://your-domain.com` | `*` |
| `LOG_LEVEL` | The log level for the server: `debug`, `info`, `warn`, and `error`. | `info` |
| Environment Variable | Description | Default |
| ---------------------- | ------------------------------------------------------------------------------------------- | --------- |
| `HOST` | The host the server listens on | `0.0.0.0` |
| `PORT` | The port the server listens on | `3000` |
| `REQUEST_TIMEOUT` | The timeout for requests formatted as a Go duration | `30s` |
| `CORS_ALLOWED_ORIGINS` | A comma-separated list of allowed origins for CORS requests, e.g. `https://your-domain.com` | `*` |
| `LOG_LEVEL` | The log level for the server: `debug`, `info`, `warn`, and `error`. | `info` |

---

## Docker Compose

Create a `docker-compose.yml` file with the following template:

```yaml
version: "3.8"
services:
railway-image-service:
image: ghcr.io/jaredlunde/railway-image-service:latest
ports:
- "3000:3000"
volumes:
- ./data:/data
environment:
- SECRET_KEY=your_secret_key_here
- SIGNATURE_SECRET_KEY=your_signature_secret_key_here
```
---
Expand Down

0 comments on commit b91a557

Please sign in to comment.