Skip to content

Commit 9dc00b0

Browse files
committed
first draft
1 parent e593428 commit 9dc00b0

9 files changed

+101
-0
lines changed

.env

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
DOCKER4GIS_VERSION=0.0.81
2+
DOCKER_REGISTRY=docker.io
3+
DOCKER_USER=docker4gis
4+
DOCKER_REPO=angular

Dockerfile

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM node:18.2.0 as builder
2+
3+
# This may come in handy.
4+
ONBUILD ARG DOCKER_USER
5+
ONBUILD ENV DOCKER_USER=$DOCKER_USER
6+
7+
RUN mkdir /src
8+
WORKDIR /src
9+
ONBUILD COPY . .
10+
ONBUILD RUN npm install
11+
ONBUILD RUN npm run build
12+
13+
FROM docker4gis/serve:v0.0.4
14+
ENV SINGLE=true
15+
RUN rm -rf /wwwroot
16+
17+
ONBUILD ARG build_dir
18+
ONBUILD COPY --from=builder ${build_dir} /wwwroot
19+
20+
# Extension template, as required by `dg component`.
21+
COPY template /template/
22+
# Make this an extensible base component; see
23+
# https://github.com/merkatorgis/docker4gis/tree/npm-package/docs#extending-base-components.
24+
# COPY conf/.docker4gis /.docker4gis
25+
COPY build.sh /.docker4gis/build.sh
26+
# COPY run.sh /.docker4gis/run.sh
27+
ONBUILD COPY conf /tmp/conf
28+
ONBUILD RUN touch /tmp/conf/args
29+
ONBUILD RUN cp /tmp/conf/args /.docker4gis

azure-pipeline-build-validation.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
trigger:
2+
- none
3+
4+
pr:
5+
- main
6+
7+
pool:
8+
vmImage: ubuntu-latest
9+
10+
steps:
11+
- script: |
12+
npx --yes docker4gis@latest build
13+
displayName: 'docker4gis build'
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
trigger:
2+
- main
3+
4+
pr:
5+
- none
6+
7+
pool:
8+
vmImage: ubuntu-latest
9+
10+
steps:
11+
- script: |
12+
git remote set-url origin https://merkatorgis:$(GITHUB_PASSWORD)@github.com/merkatorgis/docker4gis-angular.git
13+
displayName: 'git login'
14+
15+
- script: |
16+
echo '$(DOCKER_PASSWORD)' | docker login -u=docker4gis --password-stdin docker.io
17+
displayName: 'docker login'
18+
#
19+
- script: |
20+
git config --global user.email '[email protected]'
21+
git config --global user.name 'Azure Pipeline'
22+
displayName: 'git config'
23+
24+
- script: |
25+
git checkout -b main
26+
git push --set-upstream origin main
27+
displayName: 'git undo detached state'
28+
29+
- script: |
30+
npx --yes docker4gis@latest push
31+
displayName: 'docker4gis push'

build.sh

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
build_dir=$build_dir
4+
5+
docker image build \
6+
--build-arg DOCKER_USER="$DOCKER_USER" \
7+
--build-arg build_dir="$build_dir" \
8+
-t "$IMAGE" .

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"version": "0.0.0"
3+
}

template/Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM docker4gis/angular:latest

template/build.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
# Edit, if needed, to set the directory containing the artifacts from `npm run
4+
# build`:
5+
export build_dir=/src/dist/app/
6+
7+
"$BASE"/build.sh

template/conf/args

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
##
2+
# List any arguments to pass to the container's run.sh script.
3+
# Environment variables are respected.
4+
# Lines _starting with_ # are ignored.
5+
##

0 commit comments

Comments
 (0)