Update shared references to commons
This commit is contained in:
+3
-8
@@ -11,10 +11,9 @@ RUN go mod download
|
|||||||
|
|
||||||
# Copy source code
|
# Copy source code
|
||||||
COPY *.go ./
|
COPY *.go ./
|
||||||
COPY static/ ./static/
|
|
||||||
|
|
||||||
# Build the binary
|
# Build the binary
|
||||||
RUN CGO_ENABLED=1 go build -o 1440.news .
|
RUN CGO_ENABLED=1 go build -o crawler .
|
||||||
|
|
||||||
# Runtime stage
|
# Runtime stage
|
||||||
FROM ubuntu:latest
|
FROM ubuntu:latest
|
||||||
@@ -25,13 +24,9 @@ WORKDIR /app
|
|||||||
RUN apt-get update && apt-get install -y ca-certificates tzdata curl wget && rm -rf /var/lib/apt/lists/*
|
RUN apt-get update && apt-get install -y ca-certificates tzdata curl wget && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Copy binary from builder
|
# Copy binary from builder
|
||||||
COPY --from=builder /app/1440.news .
|
COPY --from=builder /app/crawler .
|
||||||
COPY --from=builder /app/static ./static
|
|
||||||
|
|
||||||
# Create feeds directory
|
# Create feeds directory
|
||||||
RUN mkdir -p feeds
|
RUN mkdir -p feeds
|
||||||
|
|
||||||
# Expose dashboard port
|
CMD ["./crawler"]
|
||||||
EXPOSE 4321
|
|
||||||
|
|
||||||
CMD ["./1440.news"]
|
|
||||||
|
|||||||
+3
-38
@@ -1,13 +1,12 @@
|
|||||||
services:
|
services:
|
||||||
app-1440-news:
|
crawler:
|
||||||
build: .
|
build: .
|
||||||
image: atproto-1440news-app
|
image: atproto-1440news-crawler
|
||||||
container_name: atproto-1440news-app
|
container_name: atproto-1440news-crawler
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
stop_grace_period: 30s
|
stop_grace_period: 30s
|
||||||
env_file:
|
env_file:
|
||||||
- pds.env
|
- pds.env
|
||||||
- oauth.env
|
|
||||||
environment:
|
environment:
|
||||||
DB_HOST: infra-postgres
|
DB_HOST: infra-postgres
|
||||||
DB_PORT: 5432
|
DB_PORT: 5432
|
||||||
@@ -19,46 +18,12 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./vertices.txt.gz:/app/vertices.txt.gz:ro
|
- ./vertices.txt.gz:/app/vertices.txt.gz:ro
|
||||||
networks:
|
networks:
|
||||||
- proxy
|
|
||||||
- atproto
|
- atproto
|
||||||
labels:
|
|
||||||
- "traefik.enable=true"
|
|
||||||
# Production: HTTPS with Let's Encrypt for app.1440.news
|
|
||||||
- "traefik.http.routers.app-1440-news.rule=Host(`app.1440.news`)"
|
|
||||||
- "traefik.http.routers.app-1440-news.entrypoints=https"
|
|
||||||
- "traefik.http.routers.app-1440-news.tls.certresolver=letsencrypt-dns"
|
|
||||||
# Production: HTTPS for 1440.news root (accounts directory) - lower priority than PDS API paths
|
|
||||||
- "traefik.http.routers.root-1440-news.rule=Host(`1440.news`)"
|
|
||||||
- "traefik.http.routers.root-1440-news.entrypoints=https"
|
|
||||||
- "traefik.http.routers.root-1440-news.tls.certresolver=letsencrypt-dns"
|
|
||||||
- "traefik.http.routers.root-1440-news.priority=10"
|
|
||||||
# Production: HTTPS for url.1440.news (URL shortener)
|
|
||||||
- "traefik.http.routers.url-1440-news.rule=Host(`url.1440.news`)"
|
|
||||||
- "traefik.http.routers.url-1440-news.entrypoints=https"
|
|
||||||
- "traefik.http.routers.url-1440-news.tls.certresolver=letsencrypt-dns"
|
|
||||||
# Production: HTTP to HTTPS redirect for app and url subdomains
|
|
||||||
- "traefik.http.routers.app-1440-news-redirect.rule=Host(`app.1440.news`) || Host(`url.1440.news`)"
|
|
||||||
- "traefik.http.routers.app-1440-news-redirect.entrypoints=http"
|
|
||||||
- "traefik.http.routers.app-1440-news-redirect.middlewares=https-redirect"
|
|
||||||
# Production: HTTP to HTTPS redirect for 1440.news root
|
|
||||||
- "traefik.http.routers.root-1440-news-redirect.rule=Host(`1440.news`)"
|
|
||||||
- "traefik.http.routers.root-1440-news-redirect.entrypoints=http"
|
|
||||||
- "traefik.http.routers.root-1440-news-redirect.middlewares=https-redirect"
|
|
||||||
- "traefik.http.routers.root-1440-news-redirect.priority=10"
|
|
||||||
- "traefik.http.middlewares.https-redirect.redirectscheme.scheme=https"
|
|
||||||
- "traefik.http.middlewares.https-redirect.redirectscheme.permanent=true"
|
|
||||||
# Local development: HTTP only
|
|
||||||
- "traefik.http.routers.app-1440-news-local.rule=Host(`app.1440.localhost`) || Host(`url.1440.localhost`)"
|
|
||||||
- "traefik.http.routers.app-1440-news-local.entrypoints=http"
|
|
||||||
# Shared service
|
|
||||||
- "traefik.http.services.app-1440-news.loadbalancer.server.port=4321"
|
|
||||||
|
|
||||||
secrets:
|
secrets:
|
||||||
db_password:
|
db_password:
|
||||||
file: ../../../infra/postgres/secrets/dba_1440_news_password.txt
|
file: ../../../infra/postgres/secrets/dba_1440_news_password.txt
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
proxy:
|
|
||||||
external: true
|
|
||||||
atproto:
|
atproto:
|
||||||
external: true
|
external: true
|
||||||
|
|||||||
Reference in New Issue
Block a user