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
|
# tag it as build
|
||||||
WORKDIR /usr/src/blog
|
FROM oven/bun AS build
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
FROM bas AS install
|
COPY bun.lockb .
|
||||||
RUN mkdir -p /temp/prod
|
COPY package.json .
|
||||||
COPY package.json bun.lockb /temp/prod/
|
|
||||||
RUN cd /temp/prod && bun install --frozen-lockfile --production
|
|
||||||
|
|
||||||
|
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:
|
# davesmithhayes.com
|
||||||
```sh
|
|
||||||
bun install
|
|
||||||
```
|
|
||||||
|
|
||||||
To run:
|
This repository holds the code that deploys into the blog for Dave Smith-Hayes.
|
||||||
```sh
|
|
||||||
bun run dev
|
|
||||||
```
|
|
||||||
|
|
||||||
open http://localhost:3000
|
|
||||||
|
@ -38,6 +38,7 @@ app.use('/static/*', serveStatic({
|
|||||||
app.route('/', home);
|
app.route('/', home);
|
||||||
app.route('/posts', posts);
|
app.route('/posts', posts);
|
||||||
|
|
||||||
|
console.log("Starting the blog application");
|
||||||
export default {
|
export default {
|
||||||
port: process.env.APP_PORT || 3000,
|
port: process.env.APP_PORT || 3000,
|
||||||
fetch: app.fetch
|
fetch: app.fetch
|
||||||
|
Loading…
Reference in New Issue
Block a user