Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/docker-image #132

Merged
merged 6 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
51 changes: 51 additions & 0 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,54 @@ jobs:

- name: Code Linting
run: npm run lint

build:
name: Build
if: github.ref == 'refs/heads/main' && success()
needs: linting
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Login Github Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: scrumlr.io - Landing Page - Build
id: meta-landing-page
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/inovex/scrumlr.io-landing-page/image
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=latest
type=sha,prefix=sha-,format=short
labels: |
[email protected]
org.opencontainers.image.url=https://github.com/inovex/scrumlr.io/pkgs/container/scrumlr.io-landing-page%2Fimage
org.opencontainers.image.source=https://github.com/inovex/scrumlr.io-landing-page
org.opencontainers.image.vendor=inovex
org.opencontainers.image.licenses=MIT
org.opencontainers.image.title=scrumlr.io - Landing Page
org.opencontainers.image.description=The landing page of scrumlr.io

- name: Set up Docker buildx
uses: docker/setup-buildx-action@v2

- name: Push landing page image
id: push-landing-page
uses: docker/build-push-action@v4
with:
push: true
tags: ${{ steps.meta-landing-page.outputs.tags }}
labels: ${{ steps.meta-landing-page.outputs.labels }}
build-args: |
DIRECTUS_URL=${{ secrets.DIRECTUS_URL }}
DIRECTUS_TOKEN=${{ secrets.DIRECTUS_TOKEN }}
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM node:18 AS build
WORKDIR /app
ARG DIRECTUS_URL
ARG DIRECTUS_TOKEN
COPY package*.json ./
RUN npm install -g pnpm
RUN pnpm install
COPY . .
RUN echo "DIRECTUS_URL = ${DIRECTUS_URL}" >> .env
RUN echo "DIRECTUS_TOKEN = ${DIRECTUS_TOKEN}" >> .env
RUN pnpm run build
RUN rm -rf .env

FROM nginx:alpine AS runtime
COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 8080
31 changes: 31 additions & 0 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
worker_processes 1;

events {
worker_connections 1024;
}

http {
server {
listen 8080;
server_name _;

root /usr/share/nginx/html;
index index.html index.htm;
include /etc/nginx/mime.types;

gzip on;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;

error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
internal;
}

location / {
try_files $uri $uri/index.html =404;
}
}
}
2 changes: 1 addition & 1 deletion src/pages/[lang]/Legal/Cookies.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import type {GetStaticPaths} from "astro";
import LegalLayout from "../../../layouts/LegalLayout.astro";
import getTranslatedContent from "../../../utils/directus.ts";
import "./legal.scss";
import "./Legal.scss";

const {lang} = Astro.params;
const content = await getTranslatedContent("Cookie_Policy", lang!);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/[lang]/Legal/Privacy.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import type {GetStaticPaths} from "astro";
import LegalLayout from "../../../layouts/LegalLayout.astro";
import getTranslatedContent from "../../../utils/directus.ts";
import "./legal.scss";
import "./Legal.scss";

const {lang} = Astro.params;
const content = await getTranslatedContent("Privacy_Policy", lang!);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/[lang]/Legal/Terms.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import type { GetStaticPaths } from "astro";
import LegalLayout from "../../../layouts/LegalLayout.astro";
import getTranslatedContent from "../../../utils/directus.ts";
import "./legal.scss";
import "./Legal.scss";

const {lang} = Astro.params;
const content = await getTranslatedContent("Terms_Conditions", lang!);
Expand Down
Loading