summaryrefslogtreecommitdiff
path: root/frontend/Dockerfile
blob: 791cd875c9bbbb2b2d138dac4e05435511561079 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# syntax=docker/dockerfile:1

# BUILD STAGE
FROM node:22-alpine AS builder

WORKDIR /app

COPY package*.json ./

RUN npm ci

# Copy .env.docker as .env for Vite
COPY .env.docker .env

COPY . .

# Compile TypeScript & create optimized production build
RUN npm run build

# PRODUCTION STAGE
FROM nginx:alpine AS production

# Copy production build files to nginx
COPY --from=builder /app/dist /usr/share/nginx/html

COPY nginx.conf /etc/nginx/conf.d/default.conf

EXPOSE 80