Skip to content

Commit

Permalink
Merge pull request #58 from sayyyho/dev
Browse files Browse the repository at this point in the history
Fix: 도커파일 수정
  • Loading branch information
sayyyho authored Aug 29, 2024
2 parents 6f3db80 + 10a45cd commit 1b50daa
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Base image
# Base image with Node.js
FROM node:18-alpine as build

# Set working directory
Expand All @@ -16,12 +16,18 @@ RUN npm run build

# Production image for Nginx
FROM nginx:alpine

# Make sure the app directory is created in this stage
WORKDIR /app

COPY --from=build /app/dist /usr/share/nginx/html
COPY --from=build /app/server.js /app

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

# Run Nginx and Node.js server together
# Expose ports
EXPOSE 80 3000

# Start Nginx and Node.js server
CMD ["sh", "-c", "node /app/server.cjs & nginx -g 'daemon off;'"]

0 comments on commit 1b50daa

Please sign in to comment.