-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* wip * add openssl * mmm.... * rename
- Loading branch information
Showing
2 changed files
with
57 additions
and
0 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,36 @@ | ||
name: Docker Image for Postgres Migration | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "prisma/migrations/**" | ||
pull_request: | ||
merge_group: | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: hadolint/[email protected] | ||
with: | ||
dockerfile: Dockerfile.migration | ||
|
||
- uses: docker/setup-buildx-action@v2 | ||
- uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- run: echo "LATEST_MIGRATION_NAME=$(ls -1 --ignore migration_lock.toml --reverse | head -n 1)" >> $GITHUB_ENV | ||
- uses: docker/build-push-action@v4 | ||
with: | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
context: . | ||
file: Dockerfile.migration | ||
push: ${{ github.event_name == 'push' }} | ||
tags: ghcr.io/${{ github.repository_owner }}/api-postgres-migration:${{ env.LATEST_MIGRATION_NAME }} |
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,21 @@ | ||
FROM node:20.8.1-slim@sha256:4fa1430cd19507875e65896fdf3176fc1674bc5bbf51b5f750fa30484885c18d | ||
WORKDIR /app | ||
|
||
# install OpenSSL | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends openssl=3.0.11-1~deb12u1 \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
## install tini | ||
ADD https://github.com/krallin/tini/releases/download/v0.19.0/tini /bin/tini | ||
RUN chmod +x /bin/tini | ||
|
||
## install all node.js dependencies | ||
COPY package.json package-lock.json .npmrc ./ | ||
RUN npm ci | ||
|
||
COPY ./prisma ./prisma | ||
|
||
ENTRYPOINT ["tini", "--"] | ||
CMD ["./node_modules/.bin/prisma", "migrate", "deploy"] |