Fixed failing Dockerfile (openssl3 + prisma).

This commit is contained in:
Martin Sosic 2022-12-13 11:34:59 +01:00 committed by Martin Šošić
parent ce31d940ac
commit 6ba114ecbe
12 changed files with 63 additions and 16 deletions

View File

@ -73,7 +73,7 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
# TODO: Right now, actions/cache updates cache only if cache was not fetched.
# TODO: Right now, actions/cache updates cache only if cache was not fe
# This is not ideal for us, because we would ideally update cache even if it
# was fetched, because we want to cache any newly installed packages.
# This was working normally on Travis and Appveyor.
@ -104,6 +104,10 @@ jobs:
with:
node-version: '18'
- name: On MacOS, skip e2e tests with Docker since it is not installed
if: matrix.os == 'macos-latest'
run: export WASP_E2E_TESTS_SKIP_DOCKER=1
- name: Run tests
run: cabal test

View File

@ -1,5 +1,9 @@
{{={= =}=}}
FROM node:{= nodeMajorVersion =}-alpine AS node
# NOTE: Why do we specify alpine version here?
# Because if not, we had situations where it would use the different version
# locally and on Github CI. This way we ensure exact version is used,
# and also have control over updating it (instead of update surprising us).
FROM node:{= nodeMajorVersion =}-alpine3.17 AS node
FROM node AS base
@ -7,8 +11,11 @@ RUN apk --no-cache -U upgrade # To ensure any potential security patches are app
FROM base AS server-builder
# Install packages needed to build native npm packages.
RUN apk add --no-cache build-base libtool autoconf automake python3
# TODO: Remove line below (installation of openssl 1.1) once Prisma adds support for
# openssl 3 on alpine. Alpine >= 3.17 has openssl 3 as default.
# Relevant GH issue: https://github.com/wasp-lang/wasp/issues/877
RUN apk add --no-cache openssl1.1-compat
WORKDIR /app
# Install npm packages, resulting in node_modules/.
{=# usingServerPatches =}

View File

@ -14,6 +14,7 @@ module ShellCommands
waspCliCompile,
waspCliMigrate,
waspCliBuild,
dockerBuild,
)
where
@ -105,3 +106,8 @@ waspCliMigrate migrationName =
waspCliBuild :: ShellCommandBuilder ShellCommand
waspCliBuild = return "wasp-cli build"
dockerBuild :: ShellCommandBuilder ShellCommand
dockerBuild =
return
"[ -z \"$WASP_E2E_TESTS_SKIP_DOCKER\" ] && cd .wasp/build && docker build . && cd ../.. || true"

View File

@ -3,6 +3,7 @@ module Tests.WaspBuildTest (waspBuild) where
import GoldenTest (GoldenTest, makeGoldenTest)
import ShellCommands
( cdIntoCurrentProject,
dockerBuild,
setDbToPSQL,
waspCliBuild,
waspCliNew,
@ -15,5 +16,6 @@ waspBuild =
[ waspCliNew,
cdIntoCurrentProject,
setDbToPSQL,
waspCliBuild
waspCliBuild,
dockerBuild
]

View File

@ -11,7 +11,7 @@
"file",
"Dockerfile"
],
"c11eaf8c89e4dd4321444e4951f0047b2f1c4784c84edb027e06185359472781"
"23e349c902e95729709edde1e2605da6d464d666cf40271ce3aacdebb7760c40"
],
[
[

View File

@ -1,4 +1,8 @@
FROM node:18-alpine AS node
# NOTE: Why do we specify alpine version here?
# Because if not, we had situations where it would use the different version
# locally and on Github CI. This way we ensure exact version is used,
# and also have control over updating it (instead of update surprising us).
FROM node:18-alpine3.17 AS node
FROM node AS base
@ -6,8 +10,11 @@ RUN apk --no-cache -U upgrade # To ensure any potential security patches are app
FROM base AS server-builder
# Install packages needed to build native npm packages.
RUN apk add --no-cache build-base libtool autoconf automake python3
# TODO: Remove line below (installation of openssl 1.1) once Prisma adds support for
# openssl 3 on alpine. Alpine >= 3.17 has openssl 3 as default.
# Relevant GH issue: https://github.com/wasp-lang/wasp/issues/877
RUN apk add --no-cache openssl1.1-compat
WORKDIR /app
# Install npm packages, resulting in node_modules/.
COPY server/package*.json ./server/

View File

@ -11,7 +11,7 @@
"file",
"Dockerfile"
],
"c11eaf8c89e4dd4321444e4951f0047b2f1c4784c84edb027e06185359472781"
"23e349c902e95729709edde1e2605da6d464d666cf40271ce3aacdebb7760c40"
],
[
[

View File

@ -1,4 +1,8 @@
FROM node:18-alpine AS node
# NOTE: Why do we specify alpine version here?
# Because if not, we had situations where it would use the different version
# locally and on Github CI. This way we ensure exact version is used,
# and also have control over updating it (instead of update surprising us).
FROM node:18-alpine3.17 AS node
FROM node AS base
@ -6,8 +10,11 @@ RUN apk --no-cache -U upgrade # To ensure any potential security patches are app
FROM base AS server-builder
# Install packages needed to build native npm packages.
RUN apk add --no-cache build-base libtool autoconf automake python3
# TODO: Remove line below (installation of openssl 1.1) once Prisma adds support for
# openssl 3 on alpine. Alpine >= 3.17 has openssl 3 as default.
# Relevant GH issue: https://github.com/wasp-lang/wasp/issues/877
RUN apk add --no-cache openssl1.1-compat
WORKDIR /app
# Install npm packages, resulting in node_modules/.
COPY server/package*.json ./server/

View File

@ -11,7 +11,7 @@
"file",
"Dockerfile"
],
"c11eaf8c89e4dd4321444e4951f0047b2f1c4784c84edb027e06185359472781"
"23e349c902e95729709edde1e2605da6d464d666cf40271ce3aacdebb7760c40"
],
[
[

View File

@ -1,4 +1,8 @@
FROM node:18-alpine AS node
# NOTE: Why do we specify alpine version here?
# Because if not, we had situations where it would use the different version
# locally and on Github CI. This way we ensure exact version is used,
# and also have control over updating it (instead of update surprising us).
FROM node:18-alpine3.17 AS node
FROM node AS base
@ -6,8 +10,11 @@ RUN apk --no-cache -U upgrade # To ensure any potential security patches are app
FROM base AS server-builder
# Install packages needed to build native npm packages.
RUN apk add --no-cache build-base libtool autoconf automake python3
# TODO: Remove line below (installation of openssl 1.1) once Prisma adds support for
# openssl 3 on alpine. Alpine >= 3.17 has openssl 3 as default.
# Relevant GH issue: https://github.com/wasp-lang/wasp/issues/877
RUN apk add --no-cache openssl1.1-compat
WORKDIR /app
# Install npm packages, resulting in node_modules/.
COPY server/package*.json ./server/

View File

@ -11,7 +11,7 @@
"file",
"Dockerfile"
],
"5199be314e1006eca5bbd649f1330d2fc508f15ecbcf33d508763b15aa304923"
"a52da8d519ba59a3c3e2c90bad1e8231c084fbf2db4993b1846bdd03cb4651c2"
],
[
[

View File

@ -1,4 +1,8 @@
FROM node:18-alpine AS node
# NOTE: Why do we specify alpine version here?
# Because if not, we had situations where it would use the different version
# locally and on Github CI. This way we ensure exact version is used,
# and also have control over updating it (instead of update surprising us).
FROM node:18-alpine3.17 AS node
FROM node AS base
@ -6,8 +10,11 @@ RUN apk --no-cache -U upgrade # To ensure any potential security patches are app
FROM base AS server-builder
# Install packages needed to build native npm packages.
RUN apk add --no-cache build-base libtool autoconf automake python3
# TODO: Remove line below (installation of openssl 1.1) once Prisma adds support for
# openssl 3 on alpine. Alpine >= 3.17 has openssl 3 as default.
# Relevant GH issue: https://github.com/wasp-lang/wasp/issues/877
RUN apk add --no-cache openssl1.1-compat
WORKDIR /app
# Install npm packages, resulting in node_modules/.
COPY server/package*.json ./server/