Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cd-develop and dockerfile. #115

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/cd-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ jobs:
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ${{ env.DOCKERFILE_PATH }}
context: packages/javascript-sdk
file: docker/Dockerfile
push: true
tags: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
17 changes: 13 additions & 4 deletions packages/javascript-sdk/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
# Stage 1: Build the application
FROM node:16.5.0-alpine AS builder
WORKDIR /usr/src
COPY . .
RUN pnpm install && pnpm build

# Stage 2: Set up Nginx to serve the built application
FROM nginx:latest
COPY --from=builder /usr/src/dist/lib.js /usr/share/nginx/html
COPY --from=builder /usr/src/dist/lib.js /usr/share/nginx/html/

# Remove default Nginx configurations
RUN rm /etc/nginx/nginx.conf && rm /etc/nginx/conf.d/default.conf
RUN ls -al
COPY nginx.conf /etc/nginx/nginx.conf
COPY default.conf /etc/nginx/conf.d/default.conf

# Copy custom Nginx configurations
COPY docker/nginx.conf /etc/nginx/nginx.conf
COPY docker/default.conf /etc/nginx/conf.d/default.conf

# Optional: List directory contents for debugging
RUN ls -al /etc/nginx
RUN ls -al /usr/share/nginx/html
Loading