mirror of
https://github.com/formbricks/formbricks.git
synced 2026-05-02 19:40:35 -05:00
fix: docker build errors (#1762)
This commit is contained in:
@@ -52,19 +52,22 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
cosign-release: "v2.1.1"
|
cosign-release: "v2.1.1"
|
||||||
|
|
||||||
|
# Add support for more platforms with QEMU (optional)
|
||||||
|
# https://github.com/docker/setup-qemu-action
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
# Set up BuildKit Docker container builder to be able to build
|
# Set up BuildKit Docker container builder to be able to build
|
||||||
# multi-platform images and export cache
|
# multi-platform images and export cache
|
||||||
# https://github.com/docker/setup-buildx-action
|
# https://github.com/docker/setup-buildx-action
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
|
uses: docker/setup-buildx-action@v3 # v3.0.0
|
||||||
with:
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
|
|
||||||
# Login against a Docker registry except on PR
|
# Login against a Docker registry except on PR
|
||||||
# https://github.com/docker/login-action
|
# https://github.com/docker/login-action
|
||||||
- name: Log into registry ${{ env.REGISTRY }}
|
- name: Log into registry ${{ env.REGISTRY }}
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
|
uses: docker/login-action@v3 # v3.0.0
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.REGISTRY }}
|
registry: ${{ env.REGISTRY }}
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
@@ -74,7 +77,7 @@ jobs:
|
|||||||
# https://github.com/docker/metadata-action
|
# https://github.com/docker/metadata-action
|
||||||
- name: Extract Docker metadata
|
- name: Extract Docker metadata
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
|
uses: docker/metadata-action@v5 # v5.0.0
|
||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
|
|
||||||
@@ -82,10 +85,11 @@ jobs:
|
|||||||
# https://github.com/docker/build-push-action
|
# https://github.com/docker/build-push-action
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
id: build-and-push
|
id: build-and-push
|
||||||
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
|
uses: docker/build-push-action@v5 # v5.0.0
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./apps/web/Dockerfile
|
file: ./apps/web/Dockerfile
|
||||||
|
# platforms: linux/amd64,linux/arm64
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|||||||
@@ -1,13 +1,19 @@
|
|||||||
# Installer stage: Building the application
|
# Installer stage: Building the application
|
||||||
FROM node:20-alpine AS installer
|
FROM node:20-alpine AS installer
|
||||||
|
|
||||||
|
# Enable corepack and prepare pnpm
|
||||||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||||
|
|
||||||
|
# Install necessary build tools and compilers
|
||||||
|
RUN apk update && apk add --no-cache g++ cmake make gcc python3 openssl-dev
|
||||||
|
|
||||||
# Install Supercronic (cron for containers without super user privileges)
|
# Install Supercronic (cron for containers without super user privileges)
|
||||||
RUN apk add --no-cache curl \
|
RUN apk add --no-cache curl \
|
||||||
&& curl -fsSLo /tmp/supercronic \
|
&& curl -fsSLo /tmp/supercronic \
|
||||||
"https://github.com/aptible/supercronic/releases/download/v0.2.27/supercronic-linux-amd64" \
|
"https://github.com/aptible/supercronic/releases/download/v0.2.27/supercronic-linux-amd64" \
|
||||||
&& chmod +x /tmp/supercronic
|
&& chmod +x /tmp/supercronic
|
||||||
|
|
||||||
|
# Set environment variables
|
||||||
ARG DATABASE_URL
|
ARG DATABASE_URL
|
||||||
ENV DATABASE_URL=$DATABASE_URL
|
ENV DATABASE_URL=$DATABASE_URL
|
||||||
|
|
||||||
@@ -17,13 +23,19 @@ ENV NEXTAUTH_SECRET=$NEXTAUTH_SECRET
|
|||||||
ARG ENCRYPTION_KEY
|
ARG ENCRYPTION_KEY
|
||||||
ENV ENCRYPTION_KEY=$ENCRYPTION_KEY
|
ENV ENCRYPTION_KEY=$ENCRYPTION_KEY
|
||||||
|
|
||||||
|
# Set the working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy the application files
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
# Create a .env file
|
||||||
RUN touch /app/apps/web/.env
|
RUN touch /app/apps/web/.env
|
||||||
|
|
||||||
|
# Install the dependencies
|
||||||
RUN pnpm install
|
RUN pnpm install
|
||||||
|
|
||||||
|
|
||||||
# Build the project
|
# Build the project
|
||||||
RUN pnpm post-install --filter=web...
|
RUN pnpm post-install --filter=web...
|
||||||
RUN pnpm turbo run build --filter=web...
|
RUN pnpm turbo run build --filter=web...
|
||||||
|
|||||||
@@ -38,10 +38,6 @@ const nextConfig = {
|
|||||||
protocol: "https",
|
protocol: "https",
|
||||||
hostname: "formbricks-cdn.s3.eu-central-1.amazonaws.com",
|
hostname: "formbricks-cdn.s3.eu-central-1.amazonaws.com",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
protocol: "https",
|
|
||||||
hostname: `${getHostname(process.env.WEBAPP_URL)}`,
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
async redirects() {
|
async redirects() {
|
||||||
@@ -116,6 +112,10 @@ if (process.env.WEBAPP_URL) {
|
|||||||
nextConfig.experimental.serverActions = {
|
nextConfig.experimental.serverActions = {
|
||||||
allowedOrigins: [process.env.WEBAPP_URL.replace(/https?:\/\//, "")],
|
allowedOrigins: [process.env.WEBAPP_URL.replace(/https?:\/\//, "")],
|
||||||
};
|
};
|
||||||
|
nextConfig.images.remotePatterns.push({
|
||||||
|
protocol: "https",
|
||||||
|
hostname: getHostname(process.env.WEBAPP_URL),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const sentryOptions = {
|
const sentryOptions = {
|
||||||
|
|||||||
Reference in New Issue
Block a user