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
|
WORKDIR /app
|
||||||
|
|
||||||
|
ARG PUB_ENV
|
||||||
ARG PUB_HOSTNAME
|
ARG PUB_HOSTNAME
|
||||||
ARG PUB_PLAUSIBLE_URL
|
ARG PUB_PLAUSIBLE_URL
|
||||||
|
|
||||||
|
ENV PUB_ENV=${PUB_ENV}
|
||||||
ENV PUB_HOSTNAME=${PUB_HOSTNAME}
|
ENV PUB_HOSTNAME=${PUB_HOSTNAME}
|
||||||
ENV PUB_PLAUSIBLE_URL=${PUB_PLAUSIBLE_URL}
|
ENV PUB_PLAUSIBLE_URL=${PUB_PLAUSIBLE_URL}
|
||||||
|
|
||||||
COPY package.json ./
|
COPY package.json ./
|
||||||
|
COPY patches/ ./patches
|
||||||
|
|
||||||
RUN bun install
|
RUN bun install
|
||||||
|
|
||||||
|
|
@ -16,12 +19,8 @@ COPY . ./
|
||||||
|
|
||||||
RUN bun run build
|
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 ./
|
COPY --from=builder /app/build /usr/share/nginx/html
|
||||||
|
|
||||||
EXPOSE 3000
|
|
||||||
|
|
||||||
CMD [ "bun", "run", "start" ]
|
|
||||||
|
|
@ -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:
|
Clone the repository, then build a Docker image with:
|
||||||
```shell
|
```shell
|
||||||
$ docker build -t not-nullptr/vert \
|
$ docker build -t not-nullptr/vert \
|
||||||
|
--build-arg PUB_ENV=production \
|
||||||
--build-arg PUB_HOSTNAME=vert.sh \
|
--build-arg PUB_HOSTNAME=vert.sh \
|
||||||
--build-arg PUB_PLAUSIBLE_URL=https://plausible.example.com .
|
--build-arg PUB_PLAUSIBLE_URL=https://plausible.example.com .
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ services:
|
||||||
args:
|
args:
|
||||||
PUB_HOSTNAME: "vert.sh"
|
PUB_HOSTNAME: "vert.sh"
|
||||||
PUB_PLAUSIBLE_URL: "https://plausible.example.com"
|
PUB_PLAUSIBLE_URL: "https://plausible.example.com"
|
||||||
|
PUB_ENV: "production"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
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