Skip to content

Commit c2c0966

Browse files
pashidloss-weigand
andauthored
🩹 Use debian base image to allow using odiff as diffing backend (#297) (#298)
* 👌 Use debian base image to allow usage of odiff Odiff isn't ABI compatible with musl-libc (alpine) and thus causes crashes when called. Where as debian uses gnu-libc which is compatible with the odiff binaries. * 🧹 Remove deprecated docker compose file version Ref.: https://github.com/compose-spec/compose-spec/blob/main/spec.md#version-and-name-top-level-elements * 🤔 Also use debian base image for migrations? (consistency) Using the same base image for migration and the API might reduce debugging afford for bugs related to prisma alpine/debian differences (i.e. binaryTargets) * 🩹🚇 Use docker compose v2 CLI call in workflow This fixes the error: "docker-compose: command not found" Co-authored-by: Sebastian Weigand <[email protected]>
1 parent 2df475c commit c2c0966

File tree

6 files changed

+11
-13
lines changed

6 files changed

+11
-13
lines changed

‎.github/workflows/workflow.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
run: npm run test:cov
2929

3030
- name: Build and run containers
31-
run: docker-compose up --build -d
31+
run: docker compose up --build -d
3232

3333
- name: Run acceptance tests
3434
run: npm run test:acceptance
@@ -38,7 +38,7 @@ jobs:
3838

3939
- name: Stop containers
4040
if: always()
41-
run: docker-compose down
41+
run: docker compose down
4242

4343
- name: SonarCloud Scan
4444
uses: SonarSource/sonarcloud-github-action@master

‎Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# https://github.com/Visual-Regression-Tracker/Visual-Regression-Tracker/issues/137
2-
FROM node:18-alpine3.18 AS builder
3-
1+
FROM node:18-bookworm-slim AS builder
42
# Create app directory
53
WORKDIR /app
64

@@ -17,8 +15,9 @@ COPY src ./src
1715

1816
RUN npm run build
1917

20-
# https://github.com/Visual-Regression-Tracker/Visual-Regression-Tracker/issues/137
21-
FROM node:18-alpine3.18
18+
FROM node:18-bookworm-slim
19+
ENV DEBIAN_FRONTEND=noninteractive
20+
RUN apt update && apt install -y libssl3 && rm -rf /var/lib/apt/lists/*
2221
COPY --from=builder /app/node_modules ./node_modules
2322
COPY --from=builder /app/package*.json ./
2423
COPY --from=builder /app/dist ./dist

‎README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- Install Node `18` (LTS)
99
- clone repo
1010
- Update `.env` and `prisma/.env`
11-
- Make sure Postgres is up and running, using `docker-compose up` in a separate terminal
11+
- Make sure Postgres is up and running, using `docker compose up` in a separate terminal
1212
- `npm i`
1313
- `npm run test`
1414
- Create DB structure `npx prisma db push`

‎docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: "3.7"
21
services:
32
api:
43
container_name: vrt_api

‎prisma/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
# https://github.com/Visual-Regression-Tracker/Visual-Regression-Tracker/issues/137
2-
FROM node:18-alpine3.18
3-
4-
RUN apk add --no-cache bash
1+
FROM node:18-bookworm-slim
2+
ENV DEBIAN_FRONTEND=noninteractive
3+
RUN apt update && apt install -y libssl3 && rm -rf /var/lib/apt/lists/*
54

65
WORKDIR /app
76

‎prisma/schema.prisma

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
generator client {
22
provider = "prisma-client-js"
3+
binaryTargets = ["native", "debian-openssl-3.0.x"]
34
}
45

56
datasource db {

0 commit comments

Comments
 (0)