Skip to content

Commit

Permalink
test lagi
Browse files Browse the repository at this point in the history
  • Loading branch information
syafiqparadisam committed Jul 24, 2024
1 parent ea463fc commit a7707e8
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions project/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,33 @@
FROM node:20.12-alpine AS build

# Set workdir in docker container
WORKDIR /app

# Copy source code
COPY . .

# Install dependencies
RUN npm install

RUN --mount=type=secret,id=VITE_TEMPLATE_ID,required=true,mode=0666 \
VITE_TEMPLATE_ID=$(cat /run/secrets/VITE_TEMPLATE_ID)

RUN --mount=type=secret,id=VITE_PUBLIC_KEY,required=true,mode=0666 \
VITE_PUBLIC_KEY=$(cat /run/secrets/VITE_PUBLIC_KEY)

RUN --mount=type=secret,id=VITE_SERVICE_ID,required=true,mode=0666 \
VITE_SERVICE_ID=$(cat /run/secrets/VITE_SERVICE_ID)
--mount=type=secret,id=VITE_PUBLIC_KEY,required=true,mode=0666 \
--mount=type=secret,id=VITE_SERVICE_ID,required=true,mode=0666 \
VITE_TEMPLATE_ID=$(cat /run/secrets/VITE_TEMPLATE_ID) \
VITE_PUBLIC_KEY=$(cat /run/secrets/VITE_PUBLIC_KEY) \
VITE_SERVICE_ID=$(cat /run/secrets/VITE_SERVICE_ID) \
npm run build

# RUN export VITE_SERVICE_ID=$(cat /run/secrets/VITE_SERVICE_ID) \
# && export VITE_TEMPLATE_ID=$(cat /run/secrets/VITE_TEMPLATE_ID) \
# && export VITE_PUBLIC_KEY=$(cat /run/secrets/VITE_PUBLIC_KEY)

WORKDIR /app

COPY . .
# ENV VITE_PUBLIC_KEY=Y5qSjyArYPDPZXVdM
# ENV VITE_SERVICE_ID=service_gyicy3e
# ENV VITE_TEMPLATE_ID=template_fo97i6y

# Install dependencies
RUN npm install

# Build the application
RUN npm run build

# Use a lightweight web server to serve the app
FROM nginx:alpine
Expand Down

0 comments on commit a7707e8

Please sign in to comment.