Backend update dockerfile for production and dev

pull/3/head
TZGyn 2 years ago
parent c5bdae445b
commit 5c5a89f03a
Signed by: TZGyn
GPG Key ID: 122EAF77AE81FD4A

@ -6,10 +6,11 @@ WORKDIR /shortener-backend
COPY ./package.json ./ COPY ./package.json ./
COPY ./bun.lockb ./ COPY ./bun.lockb ./
RUN bun install RUN bun install --production
COPY . . COPY . .
EXPOSE 3000 EXPOSE 3000
ENV NODE_ENV production
ENTRYPOINT [ "bun", "run", "./src/index.ts" ] ENTRYPOINT [ "bun", "run", "./src/index.ts" ]

@ -0,0 +1,15 @@
---
# docker-compose.yml
version: '3.9'
services:
app:
image: oven/bun
container_name: linkshortener_elysia_dev
# override default entrypoint allows us to do `bun install` before serving
entrypoint: []
# execute bun install before we start the dev server in watch mode
command: /bin/sh -c 'bun install && bun run --watch src/index.ts'
# expose the right ports
ports: [3000:3000]
# setup a host mounted volume to sync changes to the container
volumes: [./:/home/bun/app]
Loading…
Cancel
Save