-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.dist
35 lines (25 loc) · 920 Bytes
/
Dockerfile.dist
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
35
# Use an official Node runtime as a parent image
FROM node:lts-alpine as build
# Set the working directory to /app
WORKDIR /app
# Copy the package.json and package-lock.json to the container
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy the rest of the application code to the container
COPY . .
COPY src/client_settings.js.dist ./src/client_settings.js
COPY src/map_tilelayers.js.dist ./src/map_tilelayers.js
COPY webpack.config.js.dist ./webpack.config.js
# Build the React app
RUN npm run build
# Use an official Nginx runtime as a parent image
FROM nginx:stable-alpine
# Copy the ngnix.conf to the container
COPY nginx/nginx.conf.dist /etc/nginx/conf.d/default.conf
# Copy the React app build files to the container
COPY --from=build /app/dist /usr/share/nginx/html/sealog
# Expose port 80 for Nginx
EXPOSE 80
# Start Nginx when the container starts
CMD ["nginx", "-g", "daemon off;"]