diff --git a/frontend/.docker/Dockerfile b/frontend/.docker/Dockerfile index 2f75a70..494c91f 100644 --- a/frontend/.docker/Dockerfile +++ b/frontend/.docker/Dockerfile @@ -1,47 +1,23 @@ -# Build stage -FROM oven/bun:latest as build - +FROM oven/bun:debian AS build WORKDIR /app -# Copy package.json and bun.lock +RUN apt-get update -y && apt-get install nodejs -y + +ENV NODE_ENV=production + COPY package.json bun.lock ./ +RUN bun install --frozen-lockfile -# Install dependencies -RUN bun install - -# Copy the rest of the app COPY . . - -# Build the app RUN bun run build -# Production stage -FROM nginx:alpine +FROM nginx:alpine AS production -# Copy custom nginx config if needed -# COPY nginx.conf /etc/nginx/conf.d/default.conf +RUN rm /etc/nginx/conf.d/default.conf +COPY .docker/casino.conf /etc/nginx/templates/nginx.conf.template +COPY .docker/entrypoint.sh /docker-entrypoint.d/40-custom-config-env.sh -# Copy the build output -COPY --from=build /app/dist/browser /usr/share/nginx/html - -# Copy the env.js file -COPY --from=build /app/env.js /usr/share/nginx/html/env.js - -# Copy the entrypoint script -COPY docker-entrypoint.sh /docker-entrypoint.sh -RUN chmod +x /docker-entrypoint.sh - -# Install envsubst -RUN apk add --no-cache gettext - -# Update index.html to load env.js before the app -RUN sed -i 's/
/