Skip to content

Commit

Permalink
Add frontend Dockerfile. Adjust docker compose frontend service to se…
Browse files Browse the repository at this point in the history
…rvce.
  • Loading branch information
fergmac committed Aug 13, 2024
1 parent 135f4b3 commit 9945ad2
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17,724 deletions.
21 changes: 10 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ services:
#############################################################################################
minio-private:
build:
context: ./openshift/docker/minio/
context: ./gwells/openshift/docker/minio/
hostname: minio
ports:
- "9001:9001"
Expand Down Expand Up @@ -110,27 +110,26 @@ services:
### Frontend ###
#############################################################################################
frontend:
image: node:14.21.3
working_dir: /app
build:
context: ./frontend
dockerfile: Dockerfile
hostname: frontend
working_dir: /app/frontend
environment:
DEBUG: "True"
VUE_APP_AXIOS_BASE_URL: /api/
VUE_APP_VECTOR_TILE_BASE_URL: "/tiles/"
VECTOR_TILE_SERVER: "http://tileserv:7800/"
API_TARGET: "${API_TARGET:-http://backend:8000/}"
command: /bin/bash -c "
set -x &&
cd /app/frontend &&
npm install &&
npm run serve"
ports:
- "8080:8080"
volumes:
- type: bind
source: ./app/frontend
target: /app/frontend
- /app/frontend/node_modules/
# volumes:
# - type: bind
# source: ./app/frontend
# target: /app/frontend
# - /app/frontend/node_modules/
depends_on:
- backend
networks:
Expand Down
18 changes: 11 additions & 7 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
FROM node:18.12.0-slim

# RUN apt-get -y update

# RUN apt-get -y install git build-essential
FROM node:14.21.3 AS build

RUN apt-get update && apt-get install -y \
git \
build-essential \
python3 \
python3-pip \
make \
Expand All @@ -14,8 +12,14 @@ WORKDIR /app

COPY package*.json ./

RUN npm install
RUN npm i

COPY . /app

RUN npm i && npm run build
RUN npm run build

FROM node:14.21.3

COPY --from=build /app /app

# CMD ["npm run serve"]
Loading

0 comments on commit 9945ad2

Please sign in to comment.