1
0
mirror of https://github.com/tcgdex/cards-database.git synced 2025-06-13 00:09:18 +00:00

feat: Add support for ARM servers (#528)

This commit is contained in:
2025-04-30 22:53:22 +02:00
committed by GitHub
parent 13ad5fb0a2
commit 2ca455a957
3 changed files with 112 additions and 51 deletions

40
Dockerfile.github-actions Normal file
View File

@ -0,0 +1,40 @@
FROM docker.io/oven/bun:1-alpine AS build
# go to work folder
WORKDIR /usr/src/app
# allow bun user to edit folder
RUN chown -R bun:bun .
USER bun
ADD --chown=bun:bun server/package.json server/bun.lockb ./server/
# install prod deps dependencies
RUN cd server && \
bun install --frozen-install --production
# go to another VM
FROM docker.io/oven/bun:1-alpine AS prod
# inform software to be in production
ENV NODE_ENV=production
# run as non root user
USER bun
# go to work folder
WORKDIR /usr/src/app
# copy from build image
COPY --chown=bun:bun ./server/public ./public
COPY --chown=bun:bun ./server/package.json ./package.json
COPY --chown=bun:bun --from=build /usr/src/app/server/node_modules ./node_modules
COPY --chown=bun:bun ./server/src ./src
COPY --chown=bun:bun ./server/generated ./generated
# Expose port
EXPOSE 3000
# run it !
CMD ["bun", "src/index.ts"]