Skip to content

Commit

Permalink
add a locally working configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
marionb committed Sep 24, 2024
1 parent e56fe14 commit 2a568b7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 27 deletions.
14 changes: 2 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
# Build with node
FROM node:22.6.0-slim AS builder

# Accept build arguments and set them as environment variables
ARG API_BASE_URL
ARG API_ROOTURL
ARG MEDIA_URL
ARG GEOCODER_URL
ENV MEDIA_URL=${MEDIA_URL}
ENV API_BASE_URL=${API_BASE_URL}
ENV API_ROOTURL=${API_ROOTURL}

WORKDIR /usr/app

COPY package*.json ./.
RUN npm ci

COPY . .

# FIXME: should be doen in one RUN statement!
# Install gettext-base for envsubst command, used in k8s deployment
RUN apt-get update && apt-get install -y gettext-base
RUN envsubst < /usr/app/src/assets/configs/config.json.tmpl > /usr/app/src/assets/configs/config.json

RUN npm run build --localize
RUN npm run build
# Serve with nginx unpprevileged
FROM nginxinc/nginx-unprivileged:stable

Expand Down
15 changes: 2 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ DOCKER_TAG ?= latest

export DOCKER_BUILDKIT=1

# Load environment variables from .env file
ifneq (,$(wildcard .env))
include .env
export $(shell sed 's/=.*//' .env)
endif

.DEFAULT_GOAL := help

Expand All @@ -22,19 +17,13 @@ build: install ## Build npm project
.PHONY: build_docker
build_docker: ## Build docker image
docker build --tag=camptocamp/geoshop-front:$(VERSION) \
--build-arg=VERSION=$(VERSION) \
--build-arg=API_BASE_URL=$(API_BASE_URL) \
--build-arg=API_ROOTURL=$(API_ROOTURL) \
--build-arg=MEDIA_URL=$(MEDIA_URL) .
--build-arg=VERSION=$(VERSION) .
docker tag camptocamp/geoshop-front:$(VERSION) camptocamp/geoshop-front:$(DOCKER_TAG)

.PHONY: build_ghcr
build_ghcr: ## Build docker image tagged for GHCR
docker build --tag=ghcr.io/camptocamp/geoshop-front:$(VERSION) \
--build-arg=VERSION=$(VERSION) \
--build-arg=API_BASE_URL=$(API_BASE_URL) \
--build-arg=API_ROOTURL=$(API_ROOTURL) \
--build-arg=MEDIA_URL=$(MEDIA_URL) .
--build-arg=VERSION=$(VERSION) .
docker tag ghcr.io/camptocamp/geoshop-front:$(VERSION) ghcr.io/camptocamp/geoshop-front:$(DOCKER_TAG)

.PHONY: push_ghcr
Expand Down
2 changes: 1 addition & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"browserTarget": "front:build:development,de"
}
},
"defaultConfiguration": "de"
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
Expand Down
1 change: 0 additions & 1 deletion nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ server {
location /welcome {
rewrite ^/welcome/?$ / break;
}

}

0 comments on commit 2a568b7

Please sign in to comment.