forked from geonetwork/geonetwork-ui
-
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.
Merge branch 'Api_telechargement' of github.com:IGNF/geonetwork-ui in…
…to Api_telechargement
- Loading branch information
Showing
2 changed files
with
82 additions
and
11 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,64 @@ | ||
name: docker-datahub-download | ||
|
||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
on: | ||
push: | ||
branches: ['Api_telechargement'] | ||
# Publish semver tags as releases. | ||
tags: ['v*.*.*'] | ||
|
||
env: | ||
# Use docker.io for Docker Hub if empty | ||
REGISTRY: ghcr.io | ||
# github.repository as <account>/<repo> | ||
IMAGE_NAME: ${{ github.repository }}_datahub_download | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# Workaround: https://github.com/docker/build-push-action/issues/461 | ||
- name: Setup Docker buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
# Login against a Docker registry except on PR | ||
# https://github.com/docker/login-action | ||
- name: Log into registry ${{ env.REGISTRY }} | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Extract metadata (tags, labels) for Docker | ||
# https://github.com/docker/metadata-action | ||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
# Build and push Docker image with Buildx (don't push on PR) | ||
# https://github.com/docker/build-push-action | ||
- name: Build and push Docker image dathub | ||
id: build-and-push-frontend | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: ./ | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
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,13 +1,20 @@ | ||
### STAGE 1: Définir le répertoire de travail ### | ||
FROM docker.io/node:lts-alpine | ||
WORKDIR /usr/src/app | ||
COPY package.json ./ | ||
RUN npm install | ||
FROM node:16.13.0-alpine AS builder | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
RUN npm run build | ||
|
||
### STAGE 2: ### | ||
FROM docker.io/nginx:1.17.1-alpine | ||
COPY nginx.conf /etc/nginx/conf.d/nginx.conf | ||
COPY --from=build /usr/src/app/dist/geonetwork-ui-image /usr/share/nginx/html | ||
EXPOSE 80 | ||
RUN npm install | ||
|
||
RUN npx nx build app/datahub | ||
|
||
FROM nginx:stable-alpine | ||
|
||
WORKDIR /usr/share/nginx/htmlRUN rm -rf ./* | ||
|
||
COPY --from=builder /app/apps/datahub /usr/share/nginx/html | ||
|
||
|
||
RUN sed -i '10i \\ttry_files $uri $uri/ /index.html;' /etc/nginx/conf.d/default.conf | ||
|
||
ENTRYPOINT ["nginx", "-g", "daemon off;"] |