-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile_frontend
More file actions
34 lines (23 loc) · 807 Bytes
/
Dockerfile_frontend
File metadata and controls
34 lines (23 loc) · 807 Bytes
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
29
30
31
32
33
34
# Use the official Node.js image as the base image for frontend
FROM node:20.0.0-alpine AS frontend
# Set the working directory for frontend
WORKDIR /app/quirknotes/frontend
# Copy frontend package files
COPY quirknotes/frontend/package*.json ./
# Install frontend dependencies
RUN npm install
# Copy frontend source code
COPY quirknotes/frontend ./
# Build frontend
RUN npm run build
# Use a lightweight webserver to serve frontend assets
FROM nginx:alpine AS webserver
# Set the working directory for frontend
WORKDIR /usr/share/nginx/html
# Copy frontend build from frontend stage to nginx directory
COPY --from=frontend /app/quirknotes/frontend/build ./
# Expose port 3000 to serve the frontend
EXPOSE 3000
# Command to start nginx and serve frontend
CMD ["nginx", "-g", "daemon off;"]
#tests