Skip to content

Add Dockerfile for multi-stage build with Nginx#3

Open
faultoverload wants to merge 8 commits into28raining:mainfrom
faultoverload:main
Open

Add Dockerfile for multi-stage build with Nginx#3
faultoverload wants to merge 8 commits into28raining:mainfrom
faultoverload:main

Conversation

@faultoverload
Copy link

I wanted to be able to host this on my own and I like to run everything in Docker so I created this.

@28raining
Copy link
Owner

Nice. I moved vite up to latest, not sure how you got this working without doing that.

Any reason for using nginx instead of bun serve ?

@faultoverload
Copy link
Author

Nice. I moved vite up to latest, not sure how you got this working without doing that.

Any reason for using nginx instead of bun serve ?

Mostly because I have used nginx before and it worked. I tried following the bun docs to build a docker container but it seems like there should be a serve command in the package.json file that isn't there. I tried using a "bun run index.html" command as well and that builds but I dont get a working web server, maybe it should be some other file? I'm not a JS dev so just stumbling around in the dark a bit here.

@28raining
Copy link
Owner

How about this? Open to suggestions, I find this easier to understand

# to run this Dockerfile:
# docker build -t trgmc .
# docker run -p 3000:3000 trgmc
FROM oven/bun:1
WORKDIR /app
COPY package.json bun.lockb* ./
RUN bun install --frozen-lockfile
COPY . .
RUN bun run build

CMD ["bun", "serve", "dist"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants