Skip to content

Commit

Permalink
🐛 Fixed dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Wakeful-Cloud committed Apr 15, 2024
1 parent b9777ef commit 31d5afd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ npm run supabase:reset
To build the frontend for production, run:

```bash
docker build -t beacon-frontend -f deployment/frontend.dockerfile .
docker build -t beacon -f deployment/frontend.dockerfile .
```

#### Run

To run the frontend in production, run:

```bash
docker run -p 80:8080 beacon-frontend
docker run -p 80:8080 beacon
```

### Frontend Environment Variables
Expand Down
10 changes: 6 additions & 4 deletions deployment/frontend.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FROM node:20.12.2-alpine3.18@sha256:d328c7bc3305e1ab26491817936c8151a47a8861ad61
RUN apk add --no-cache git

# Set working directory
WORKDIR /dev
WORKDIR /build

# Copy source code
COPY . .
Expand All @@ -24,14 +24,16 @@ FROM caddy:2.7.6-alpine@sha256:95ce04978787e23e35143d23b8af2fbb6d6de55213b54a2e9
# Install packages
RUN apk add --no-cache wget

# Remove old files
RUN rm -rf /etc/caddy/Caddyfile /usr/share/caddy

# Create the non-root user
RUN adduser -D caddy
USER caddy

# Copy files
RUN rm -rf /etc/caddy/Caddyfile /usr/share/caddy
COPY --from=builder /dev/deployment/Caddyfile /etc/caddy/Caddyfile
COPY --from=builder /dev/dist /usr/share/caddy
COPY --from=builder /build/deployment/Caddyfile /etc/caddy/Caddyfile
COPY --from=builder /build/dist /usr/share/caddy

# Expose port
EXPOSE 8080
Expand Down

0 comments on commit 31d5afd

Please sign in to comment.