Skip to content

Commit 3ddcfc1

Browse files
committed
add dockerfile and github action
1 parent bfa08ed commit 3ddcfc1

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

.github/workflows/build-image.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build and publish Docker image
2+
on:
3+
push:
4+
branches: [ master ]
5+
tags:
6+
- "*"
7+
pull_request:
8+
branches: [ master ]
9+
jobs:
10+
push_to_registry:
11+
name: Build and push Docker image to Docker Hub
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check out the repo
15+
uses: actions/checkout@v2
16+
- name: Login to DockerHub
17+
uses: docker/login-action@v1
18+
with:
19+
username: ${{ secrets.DOCKER_USERNAME }}
20+
password: ${{ secrets.DOCKER_PASSWORD }}
21+
- name: Push dev to Docker Hub
22+
uses: docker/build-push-action@v2
23+
with:
24+
tags: eoepca/stac-manager-dev
25+
build-args: |
26+
PRIMARY_COLOR='#005ACD',SECONDARY_COLOR='#048A81',STAC_API_URL='https://eoapi.develop.eoepca.org/stac'
27+
- name: Push prod to Docker Hub
28+
uses: docker/build-push-action@v2
29+
with:
30+
tags: eoepca/stac-manager-dev
31+
secrets: |
32+
id=keycloak_url,src=${{ secrets.KEYCLOAK_URL }}
33+
id=keycloak_realm,src=${{ secrets.KEYCLOAK_REALM }}
34+
id=keycloak_client_id,src=${{ secrets.KEYCLOAK_CLIENT_ID }}
35+
build-args: |
36+
PRIMARY_COLOR='#005ACD',SECONDARY_COLOR='#048A81',STAC_API_URL='https://eoapi.develop.eoepca.org/stac'

Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM node:20-slim
2+
3+
RUN apt-get update && apt-get install -y git
4+
5+
WORKDIR /app
6+
7+
ARG PUBLIC_URL="/"
8+
ARG STAC_API_URL
9+
ARG PRIMARY_COLOR='#005ACD'
10+
ARG SECONDARY_COLOR='#048A81'
11+
12+
RUN git clone https://github.com/developmentseed/stac-manager .
13+
14+
ENV PUBLIC_URL=${PUBLIC_URL}
15+
ENV REACT_APP_STAC_API=${STAC_API_URL}
16+
ENV REACT_APP_THEME_PRIMARY_COLOR=${PRIMARY_COLOR}
17+
ENV REACT_APP_THEME_SECONDARY_COLOR=${SECONDARY_COLOR}
18+
19+
RUN npm i -g http-server
20+
RUN --mount=type=secret,id=keycloak_url \
21+
--mount=type=secret,id=keycloak_realm \
22+
--mount=type=secret,id=keycloak_client_id \
23+
export REACT_APP_KEYCLOAK_URL=$(cat /run/secrets/keycloak_url) && \
24+
export REACT_APP_KEYCLOAK_REALM=$(cat /run/secrets/keycloak_realm) && \
25+
export REACT_APP_KEYCLOAK_CLIENT_ID=$(cat /run/secrets/keycloak_client_id) && \
26+
npm i && npm run all:build
27+
28+
EXPOSE 80
29+
30+
ENTRYPOINT ["http-server"]
31+
CMD ["-p", "80", "packages/client/dist"]

0 commit comments

Comments
 (0)