Skip to content

Commit

Permalink
adding env for node-gyp fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SelfhostedPro committed Mar 3, 2024
1 parent 3dd1b64 commit f8debda
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
# Use the official Bun image for the initial stages
# See all versions at https://hub.docker.com/r/oven/bun/tags
FROM oven/bun:1-alpine as base
WORKDIR /app

# Install dependencies into a temp directory
# This will cache them and speed up future builds
FROM base AS install
COPY package.json bun.lockb ./
ENV CXXFLAGS="-stdlib=libc++"
RUN apk add --no-cache --force-overwrite --virtual=build-dependencies openssh python3-dev make g++ git && \
bun install --frozen-lockfile --ignore-scripts && \
bun install --frozen-lockfile && \
apk del build-dependencies


# Copy node_modules from the temp directory
# Then copy all (non-ignored) project files into the image
FROM node:18-alpine AS prerelease
WORKDIR /app
COPY --from=install /app/node_modules /app/node_modules
COPY . .

RUN npm run build

# Copy production dependencies and built files into the final image
Expand All @@ -29,15 +27,11 @@ LABEL build_version="Yacht version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="SelfhostedPro"

WORKDIR /app
COPY root /
RUN apk add --no-cache \
nodejs \
sqlite
COPY --from=prerelease /app/.output /app/
COPY package.json /app/

# Get Host from environment variable
# This is used to allow the container to be run on any host
ENV NUXT_HOST=0.0.0.0

EXPOSE 3000
EXPOSE 3000

0 comments on commit f8debda

Please sign in to comment.