Skip to content

Commit

Permalink
feat(build-fsvsifi): Build a second version with another URL in the f…
Browse files Browse the repository at this point in the history
…ooter
  • Loading branch information
colfes committed Nov 4, 2023
1 parent 0fb34cb commit 45b3962
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/ci-fsvsifi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Building Version 3.2.1-fsvsifi for ARM and x86

# Controls when the workflow will run
on:
pull_request:
types: [opened, synchronize, reopened]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Checkout
uses: actions/checkout@v2
with:
ref: v3.2.1
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Build and push frontend
id: docker_build_frontend
uses: docker/build-push-action@v2
with:
push: false
tags: |
fius/rallly:latest-fsvsifi
fius/rallly:v3.2.1-fsvsifi
file: apps/web/Dockerfile.fsvsifi
# context: ./apps/web
# platforms: linux/amd64,linux/arm64/v8
platforms: linux/amd64
build-args: SELF_HOSTED=true
61 changes: 61 additions & 0 deletions apps/web/Dockerfile.fsvsifi
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
FROM node:18 AS builder

WORKDIR /app
RUN yarn global add turbo
COPY . .
RUN turbo prune --scope=@rallly/web --docker

FROM node:18 AS installer

WORKDIR /app
#From here: Trying stuff out
RUN sed -i 's/name: "rallly.co"/name: "deckenpfronn.info"/g' web/src/pages/invite/[urlId].tsx
RUN sed -i 's/href="https:\/\/rallly\.co"/href="https:\/\/fsv-sindelfingen-ev\.de"/g' web/src/pages/invite/[urlId].tsx
#To here: Trying stuff out
COPY .gitignore .gitignore
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/yarn.lock ./yarn.lock
RUN yarn --network-timeout 1000000

# Build the project
COPY --from=builder /app/out/full/ .
COPY turbo.json turbo.json
RUN yarn db:generate

ARG APP_VERSION
ENV NEXT_PUBLIC_APP_VERSION=$APP_VERSION

ARG SELF_HOSTED
ENV NEXT_PUBLIC_SELF_HOSTED=$SELF_HOSTED

RUN yarn build

FROM node:18 AS runner

WORKDIR /app

RUN yarn global add prisma
# Don't run production as root
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
USER nextjs

COPY --from=builder --chown=nextjs:nodejs /app/scripts/docker-start.sh ./
COPY --from=builder --chown=nextjs:nodejs /app/packages/database/prisma ./prisma

COPY --from=installer /app/apps/web/next.config.js .
COPY --from=installer /app/apps/web/package.json .

ENV PORT 3000
EXPOSE 3000

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/standalone ./
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/static ./apps/web/.next/static
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/public ./apps/web/public

ARG SELF_HOSTED
ENV NEXT_PUBLIC_SELF_HOSTED=$SELF_HOSTED

CMD ["./docker-start.sh"]

0 comments on commit 45b3962

Please sign in to comment.