Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add Dockerfile for frontend. Update docker compose frontend service. #32

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading