Skip to content

Commit

Permalink
rework dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
djeck1432 committed Oct 2, 2024
1 parent 412756d commit 8a95751
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 23 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ services:
- "80:80"
- "443:443"
volumes:
- ./web_app/static/:/app/static/
-
- ./certs/spotnet.xyz.chain.crt:/etc/nginx/spotnet.xyz.chain.crt:ro
- ./certs/spotnet.xyz.key:/etc/nginx/spotnet.xyz.key:ro
- ./spotnet.conf:/etc/nginx/conf.d/spotnet.conf
Expand Down
26 changes: 4 additions & 22 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,9 @@
# Stage 1: Build the react app
FROM node:18 AS build
FROM node:20-alpine as build

WORKDIR /usr/src/app
WORKDIR /app

# Copy package.json and package-lock.json to install dependencies
COPY package*.json ./
RUN npm install yarn --global --force

# Install dependencies with legacy peer deps option
RUN npm install --legacy-peer-deps || true

# Copy the rest of the application source code
COPY . .

# Build the app (if there are build commands in the package.json)
RUN npm run build

# Stage 2: Serve the built app using nginx
FROM nginx:alpine

# Copy the built files from the previous stage to the nginx container
COPY --from=build /usr/src/app/build /usr/share/nginx/html

# Expose the port Nginx will listen to
EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]
RUN yarn install && yarn build

0 comments on commit 8a95751

Please sign in to comment.