mirror of https://github.com/VERT-sh/VERT.git
fix(docker): update docker image
* Add missing PUB_ENV environment variable * Copy `patches/` folder during build * Use nginx for serving files Co-authored-by: GitGitro <108683123+GitGitro@users.noreply.github.com>
This commit is contained in:
parent
21faba31f1
commit
a55d5f41a9
13
Dockerfile
13
Dockerfile
|
|
@ -2,13 +2,16 @@ FROM oven/bun AS builder
|
|||
|
||||
WORKDIR /app
|
||||
|
||||
ARG PUB_ENV
|
||||
ARG PUB_HOSTNAME
|
||||
ARG PUB_PLAUSIBLE_URL
|
||||
|
||||
ENV PUB_ENV=${PUB_ENV}
|
||||
ENV PUB_HOSTNAME=${PUB_HOSTNAME}
|
||||
ENV PUB_PLAUSIBLE_URL=${PUB_PLAUSIBLE_URL}
|
||||
|
||||
COPY package.json ./
|
||||
COPY patches/ ./patches
|
||||
|
||||
RUN bun install
|
||||
|
||||
|
|
@ -16,12 +19,8 @@ COPY . ./
|
|||
|
||||
RUN bun run build
|
||||
|
||||
FROM oven/bun:alpine
|
||||
FROM nginx:stable-alpine
|
||||
|
||||
WORKDIR /app
|
||||
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
COPY --from=builder /app/build ./
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD [ "bun", "run", "start" ]
|
||||
COPY --from=builder /app/build /usr/share/nginx/html
|
||||
|
|
@ -57,6 +57,7 @@ This will build the site to the `build` folder. You can then start the server wi
|
|||
Clone the repository, then build a Docker image with:
|
||||
```shell
|
||||
$ docker build -t not-nullptr/vert \
|
||||
--build-arg PUB_ENV=production \
|
||||
--build-arg PUB_HOSTNAME=vert.sh \
|
||||
--build-arg PUB_PLAUSIBLE_URL=https://plausible.example.com .
|
||||
```
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ services:
|
|||
args:
|
||||
PUB_HOSTNAME: "vert.sh"
|
||||
PUB_PLAUSIBLE_URL: "https://plausible.example.com"
|
||||
PUB_ENV: "production"
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- 3000:3000
|
||||
- 3000:80
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
server {
|
||||
listen 80;
|
||||
server_name vert;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
client_max_body_size 10M;
|
||||
|
||||
location / {
|
||||
try_files $uri /index.html;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue