Skip to content

Commit

Permalink
fixed frontend docker problem
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferdydh committed Nov 21, 2023
1 parent fbb49c6 commit 352ab5b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 31 deletions.
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ services:
- NODE_ENV=development
volumes:
- ./nextjs:/app
- /app/node_modules
- /app/.next
depends_on:
- python
Expand Down
30 changes: 5 additions & 25 deletions nextjs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,37 +1,17 @@
# Use a specific version of node
FROM node:20-slim AS base

# Set environment variables
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"

# Enable corepack to use pnpm
RUN corepack enable

# Set the working directory in the container
COPY . /app
WORKDIR /app

# Copy package.json and pnpm-lock.yaml (or package-lock.json/yarn.lock)
COPY package.json pnpm-lock.yaml ./

# Install stage
FROM base AS install
WORKDIR /app

# Install dependencies
# The cache mount is used to cache the pnpm store
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install @radix-ui/react-alert-dialog

# Final stage
FROM base

# Copy installed node_modules from the install stage
COPY --from=install /app/node_modules /app/node_modules

# Copy the rest of your app's source code from your host to your image filesystem.
COPY . .

# Expose the port the app runs on
EXPOSE 3000

# The command to run your application
CMD [ "pnpm", "run", "dev" ]
CMD [ "pnpm", "run", "dev" ]
6 changes: 1 addition & 5 deletions nextjs/src/app/_components/animated-cursor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import Image from "next/image";
interface AnimatedCursorProps {
targetX: number,
targetY: number,
selectedAvatar: string,
}
export const AnimatedCursor = ({ targetX, targetY, selectedAvatar }: AnimatedCursorProps) => {
export const AnimatedCursor = ({ targetX, targetY }: AnimatedCursorProps) => {
const [currentX, setCurrentX] = useState(0)
const [currentY, setCurrentY] = useState(0)
const [active, setActive] = useState(false)
Expand All @@ -21,9 +20,6 @@ export const AnimatedCursor = ({ targetX, targetY, selectedAvatar }: AnimatedCur
config: { duration: 500 },
});

console.log(selectedAvatar)
const avatarImageSrc = selectedAvatar === "ducky" ? Ducky : MrDucky;

return (
<animated.div
style={{ ...props }}
Expand Down

0 comments on commit 352ab5b

Please sign in to comment.