Work on the Dockerfile to run this application inside a container.
This commit is contained in:
parent
2749d463b5
commit
a91ae2c18e
15
.dockerignore
Normal file
15
.dockerignore
Normal file
@ -0,0 +1,15 @@
|
||||
node_modules
|
||||
Dockerfile*
|
||||
docker-compose*
|
||||
.dockerignore
|
||||
.git
|
||||
.gitignore
|
||||
README.md
|
||||
LICENSE
|
||||
.vscode
|
||||
Makefile
|
||||
helm-charts
|
||||
.env
|
||||
.editorconfig
|
||||
.idea
|
||||
coverage*
|
22
Dockerfile
22
Dockerfile
@ -1,8 +1,18 @@
|
||||
FROM oven/bun:1 AS bas
|
||||
WORKDIR /usr/src/blog
|
||||
# tag it as build
|
||||
FROM oven/bun AS build
|
||||
WORKDIR /app
|
||||
|
||||
FROM bas AS install
|
||||
RUN mkdir -p /temp/prod
|
||||
COPY package.json bun.lockb /temp/prod/
|
||||
RUN cd /temp/prod && bun install --frozen-lockfile --production
|
||||
COPY bun.lockb .
|
||||
COPY package.json .
|
||||
|
||||
RUN bun install --frozen-lockfile
|
||||
RUN mkdir src posts
|
||||
COPY ./src ./src
|
||||
COPY ./posts ./posts
|
||||
|
||||
USER bun
|
||||
EXPOSE 3000
|
||||
|
||||
CMD [ "bun", "run", "src/index.ts" ]
|
||||
# CMD [ "ls", "-la", "src" ]
|
||||
# CMD [ "pwd" ]
|
||||
|
12
README.md
12
README.md
@ -1,11 +1,3 @@
|
||||
To install dependencies:
|
||||
```sh
|
||||
bun install
|
||||
```
|
||||
# davesmithhayes.com
|
||||
|
||||
To run:
|
||||
```sh
|
||||
bun run dev
|
||||
```
|
||||
|
||||
open http://localhost:3000
|
||||
This repository holds the code that deploys into the blog for Dave Smith-Hayes.
|
||||
|
@ -38,6 +38,7 @@ app.use('/static/*', serveStatic({
|
||||
app.route('/', home);
|
||||
app.route('/posts', posts);
|
||||
|
||||
console.log("Starting the blog application");
|
||||
export default {
|
||||
port: process.env.APP_PORT || 3000,
|
||||
fetch: app.fetch
|
||||
|
Loading…
Reference in New Issue
Block a user