Skip to content

Commit

Permalink
feat: add building frontend image (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
ceski23 authored Apr 6, 2024
1 parent 1ddeb36 commit 3033850
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
16 changes: 16 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node:20.11.1-slim AS builder
ARG NG_APP_GOOGLE_MAPS_KEY=
ENV NG_APP_GOOGLE_MAPS_KEY=${NG_APP_GOOGLE_MAPS_KEY}

WORKDIR /usr/src/app

COPY frontend/package.json frontend/package-lock.json ./
RUN npm install

COPY frontend/ ./
RUN npm run build

FROM nginx:1.25.4-alpine

COPY frontend/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /usr/src/app/dist/frontend/browser /usr/share/nginx/html
11 changes: 11 additions & 0 deletions frontend/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
server {
listen 8080;
listen [::]:8080;

server_name frontend;

location / {
root /usr/share/nginx/html;
try_files $uri /index.html;
}
}

0 comments on commit 3033850

Please sign in to comment.