30 lines
721 B
Docker
30 lines
721 B
Docker
FROM oven/bun:1 AS base
|
|
WORKDIR /usr/src/app
|
|
|
|
# install dependencies into temp directory
|
|
# this will cache them and speed up future builds
|
|
COPY package.json bun.lockb ./
|
|
#RUN bun install --frozen-lockfile
|
|
RUN bun install
|
|
|
|
|
|
COPY . .
|
|
|
|
# dummy environment variable for build - DONT CHANGE!!!
|
|
ENV VITE_API_HOST=SECRET_HOST
|
|
|
|
RUN bun run build
|
|
|
|
FROM nginx:1.28.0-alpine3.21
|
|
|
|
# default environment variable that will be replaced at runtime
|
|
ENV API_HOST=http://localhost:5050
|
|
|
|
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
|
|
COPY --from=base /usr/src/app/dist /usr/share/nginx/html
|
|
|
|
# entrypoint script
|
|
COPY docker/docker-entrypoint.sh /docker-entrypoint.sh
|
|
RUN chmod +x /docker-entrypoint.sh
|
|
|
|
CMD ["/docker-entrypoint.sh"] |