Build docker image

This commit is contained in:
Kevin Yue
2023-03-09 11:06:13 -05:00
parent 0151845835
commit c46ba011f6
3 changed files with 24 additions and 0 deletions

6
.dockerignore Normal file
View File

@@ -0,0 +1,6 @@
Dockerfile
.dockerignore
.github
.vscode
node_modules
dist

View File

@@ -20,6 +20,7 @@ ENV TZ="Asia/Shanghai"
WORKDIR /app WORKDIR /app
COPY package.json . COPY package.json .
COPY public /app/public COPY public /app/public
COPY config /app/config
COPY --from=0 /app/node_modules /app/node_modules COPY --from=0 /app/node_modules /app/node_modules
COPY --from=0 /app/dist /app/dist COPY --from=0 /app/dist /app/dist

View File

@@ -35,6 +35,23 @@ Visit http://localhost:3000
## Running the app with Docker ## Running the app with Docker
### Build the image
```bash
$ docker build -t chatgpt-mirror .
```
### Run the container
```bash
$ docker run -d -p 3000:3000 --env-file .env chatgpt-mirror
```
### Run with the config file
```bash
$ docker run -d -p 3000:3000 --env-file .env -v $(pwd)/config/app.config.json:/app/config/app.config.json chatgpt-mirror
```
## Configuration ## Configuration