Skip to content

Commit

Permalink
infra tzwitter: edit dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrilevos committed Aug 11, 2023
1 parent 7df7033 commit b45a692
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tzwitter-frontend-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
sed -i '/TEZOS_RPC/d' 08_tzwitter_app/app/src/config.ts
sed -i '/ROLLUP_RPC/d' 08_tzwitter_app/app/src/config.ts
echo "export const TEZOS_RPC = 'https://rpc.ghostnet.teztnets.xyz';" >> 08_tzwitter_app/app/src/config.ts
echo "export const ROLLUP_RPC = 'https://tzwitter-rollup-test1.gcp.marigold.dev';" >> 08_tzwitter_app/app/src/config.ts
echo "export const ROLLUP_RPC = 'https://tzwitter-rollup.gcp.marigold.dev';" >> 08_tzwitter_app/app/src/config.ts
cat 08_tzwitter_app/app/src/config.ts
- name: Set up Docker Buildx
Expand Down
25 changes: 18 additions & 7 deletions 08_tzwitter_app/app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
FROM node:18-alpine
# Stage 1: Build the Vite app
FROM node:16-alpine AS build

WORKDIR /app

# Copy package.json and package-lock.json
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy local code to the container
COPY . .

RUN sed -i 's|prettier -c . \&\& ||g' package.json
# Build the app
RUN npm run build

RUN rm -rf node_modules build
RUN npm install -g [email protected]
RUN npm install
# Stage 2: Serve the Vite app
FROM node:16-alpine

RUN npm run build
WORKDIR /app

# Install the 'serve' package for serving our static files
RUN npm install -g serve

CMD ["serve", "-l", "3001", "-n", "-s", "build"]
# Copy the build output from the first stage
COPY --from=build /app/dist /app/dist

# Specify the command to run on container start
CMD ["serve", "-s", "dist", "-l", "3001"]

0 comments on commit b45a692

Please sign in to comment.