-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (22 loc) · 731 Bytes
/
Dockerfile
File metadata and controls
33 lines (22 loc) · 731 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
# Stage 1: Clone the repository and build the project
FROM node:16-buster AS build
# Install Git
RUN apt-get update && apt-get install -y git
# Define build argument for the branch or tag
ARG BRANCH=master
# Clone the specified branch or tag
RUN git clone --branch ${BRANCH} https://github.com/open-nomie/nomie6-oss.git /usr/src/app
# Set working directory
WORKDIR /usr/src/app
# Install dependencies
RUN npm install
# Build the project
RUN npm run vbuild
# Stage 2: Serve the built project using Nginx
FROM nginx:alpine
# Copy the built files from the build stage
COPY --from=build /usr/src/app/dist /usr/share/nginx/html
# Expose port 80 to the outside world
EXPOSE 80
# Start Nginx
CMD ["nginx", "-g", "daemon off;"]