Skip to content

Commit

Permalink
Merge branch 'main' into feat/34-revalidate-data-on-update
Browse files Browse the repository at this point in the history
  • Loading branch information
Flofie committed Feb 1, 2024
2 parents fccf9cf + 838b8ae commit 05c57ff
Show file tree
Hide file tree
Showing 17 changed files with 385 additions and 225 deletions.
5 changes: 3 additions & 2 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ TEMPORAL_UI_VERSION=2.21.0
POSTGRESQL_VERSION=13
POSTGRES_PASSWORD=temporal
POSTGRES_USER=temporal
POSTGRES_DEFAULT_PORT=5432
MINIO_VERSION=latest
MINIO_ROOT_USER=minioadmin
MINIO_ROOT_PASSWORD=minioadmin
MINIO_ROOT_PASSWORD=minioadmin
MONGO_ROOT_USER=mongoroot
MONGO_ROOT_PASSWORD=mongoroot
41 changes: 41 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Create and publish a Docker image
on:
push:
tags:
- "v*"

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: "{{defaultContext}}:app"
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
8 changes: 8 additions & 0 deletions app/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Dockerfile
.dockerignore
node_modules
npm-debug.log
README.md
.next
.git
.env
1 change: 1 addition & 0 deletions app/.env.local.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
MINIO_HOST=localhost
MINIO_ACCESS_KEY=
MINIO_SECRET_KEY=
MONGO_URL=
API_URL=http://localhost:3000
33 changes: 33 additions & 0 deletions app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# see https://docs.temporal.io/dev-guide/typescript/foundations#using-nodeslim-images
FROM node:18-bullseye-slim

RUN apt-get update \
&& apt-get install -y ca-certificates \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir /build
RUN mkdir /app
WORKDIR /build

COPY package*.json ./

RUN npm install

COPY . .

RUN npm run build:next
RUN npm run build:temporal

# build folder is from nextjs
RUN cp -r ./build/standalone /app/nextjs
RUN cp -r ./temporal/lib /app/worker

WORKDIR /app


ARG BUILD_VERSION="not_set"
ENV BUILD_VERSION=$BUILD_VERSION
ENV NODE_ENV=production

USER node
CMD ["node", "/app/nextjs/server.js"]
5 changes: 4 additions & 1 deletion app/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};
const nextConfig = {
distDir: "build",
output: "standalone",
};

export default nextConfig;
Loading

0 comments on commit 05c57ff

Please sign in to comment.