-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1133 from serlo/docker-test
chore: Add yarn + CI commands to test the docker build
- Loading branch information
Showing
24 changed files
with
439 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
REDIS_URL=redis://host.docker.internal:6379 | ||
SERLO_ORG_DATABASE_LAYER_HOST=host.docker.internal:8080 | ||
|
||
SERVER_HYDRA_HOST=http://host.docker.internal:4445 | ||
SERVER_KRATOS_PUBLIC_HOST=http://host.docker.internal:4433 | ||
SERVER_KRATOS_ADMIN_HOST=http://host.docker.internal:4434 | ||
SERVER_KRATOS_DB_URI=postgres://serlo:secret@host.docker.internal:5432/kratos?sslmode=disable\&max_conns=20\&max_idle_conns=4 | ||
|
||
ENMESHED_SERVER_HOST="http://host.docker.internal:8081/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+7.52 KB
.yarn/cache/@luckycatfactory-esbuild-graphql-loader-npm-3.8.1-1a81d6151c-8227577ce0.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,32 @@ | ||
FROM node:18 as dependencies | ||
FROM node:18 as base | ||
WORKDIR /usr/src/app | ||
COPY .yarn .yarn | ||
COPY .yarnrc.yml . | ||
COPY scripts/build.ts scripts/build.ts | ||
COPY tsconfig.json . | ||
COPY tsconfig.prod.json . | ||
COPY packages/authorization/package.json packages/authorization/package.json | ||
COPY packages/graphql-modules/package.json packages/graphql-modules/package.json | ||
COPY packages/server/package.json packages/server/package.json | ||
COPY packages/types/package.json packages/types/package.json | ||
COPY .yarnrc.yml . | ||
COPY package.json . | ||
COPY lerna.json . | ||
COPY yarn.lock . | ||
RUN yarn --immutable --immutable-cache --silent | ||
|
||
FROM dependencies as build | ||
FROM base as build_dist | ||
RUN yarn --immutable --immutable-cache --silent | ||
COPY packages/authorization packages/authorization | ||
COPY packages/graphql-modules packages/graphql-modules | ||
COPY packages/server packages/server | ||
COPY packages/graphql-modules packages/graphql-modules | ||
COPY packages/types packages/types | ||
COPY lerna.json . | ||
COPY tsconfig.json . | ||
COPY tsconfig.prod.json . | ||
RUN yarn lerna run --include-dependencies --scope @serlo/authorization build | ||
RUN yarn lerna run --scope @serlo/api.serlo.org build:server | ||
RUN yarn build:server | ||
|
||
FROM base as build_node_modules | ||
RUN yarn workspaces focus @serlo/api.serlo.org --production | ||
|
||
FROM dependencies as release | ||
COPY --from=build /usr/src/app/packages/authorization/dist packages/authorization/dist | ||
COPY --from=build /usr/src/app/packages/server/dist packages/server/dist | ||
COPY --from=build /usr/src/app/packages/types/dist packages/types/dist | ||
WORKDIR /usr/src/app/packages/server | ||
ENTRYPOINT ["node", "dist"] | ||
FROM node:18-alpine as release | ||
WORKDIR /usr/src/app | ||
COPY --from=build_dist /usr/src/app/dist dist | ||
COPY --from=build_node_modules /usr/src/app/node_modules node_modules | ||
ENTRYPOINT ["node", "dist/server.cjs"] | ||
EXPOSE 3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,32 @@ | ||
FROM node:18 as dependencies | ||
FROM node:18 as base | ||
WORKDIR /usr/src/app | ||
COPY .yarn .yarn | ||
COPY .yarnrc.yml . | ||
COPY scripts/build.ts scripts/build.ts | ||
COPY tsconfig.json . | ||
COPY tsconfig.prod.json . | ||
COPY packages/authorization/package.json packages/authorization/package.json | ||
COPY packages/graphql-modules/package.json packages/graphql-modules/package.json | ||
COPY packages/server/package.json packages/server/package.json | ||
COPY packages/types/package.json packages/types/package.json | ||
COPY .yarnrc.yml . | ||
COPY package.json . | ||
COPY lerna.json . | ||
COPY yarn.lock . | ||
RUN yarn --immutable --immutable-cache --silent | ||
|
||
FROM dependencies as build | ||
FROM base as build_dist | ||
RUN yarn --immutable --immutable-cache --silent | ||
COPY packages/authorization packages/authorization | ||
COPY packages/graphql-modules packages/graphql-modules | ||
COPY packages/server packages/server | ||
COPY packages/graphql-modules packages/graphql-modules | ||
COPY packages/types packages/types | ||
COPY lerna.json . | ||
COPY tsconfig.json . | ||
COPY tsconfig.prod.json . | ||
RUN yarn lerna run --include-dependencies --scope @serlo/authorization build | ||
RUN yarn lerna run --scope @serlo/api.serlo.org build:swr-queue-worker | ||
RUN yarn build:swr-queue-worker | ||
|
||
FROM base as build_node_modules | ||
RUN yarn workspaces focus @serlo/api.serlo.org --production | ||
|
||
FROM dependencies as release | ||
COPY --from=build /usr/src/app/packages/authorization/dist packages/authorization/dist | ||
COPY --from=build /usr/src/app/packages/server/dist packages/server/dist | ||
COPY --from=build /usr/src/app/packages/types/dist packages/types/dist | ||
WORKDIR /usr/src/app/packages/server | ||
ENTRYPOINT ["node", "dist"] | ||
FROM node:18-alpine as release | ||
WORKDIR /usr/src/app | ||
COPY --from=build_dist /usr/src/app/dist dist | ||
COPY --from=build_node_modules /usr/src/app/node_modules node_modules | ||
ENTRYPOINT ["node", "dist/swr-queue-worker.cjs"] | ||
EXPOSE 3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import R from 'ramda' | ||
import * as R from 'ramda' | ||
|
||
import { Instance, InstanceAware } from '~/types' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import R from 'ramda' | ||
import * as R from 'ramda' | ||
|
||
import { TypeResolvers } from '~/internals/graphql' | ||
import { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.