Implementation of server and reverse proxy

This commit is contained in:
2025-01-13 23:39:31 +00:00
parent 71231303f2
commit 96fab302b5
4 changed files with 48 additions and 5 deletions

View File

@@ -1,8 +1,6 @@
FROM almalinux:latest
ENV SOCKET_PATH=false
ENV HOST="0.0.0.0"
ENV PORT=3000
ENV NODE_ENV="production"
RUN dnf upgrade --assumeyes
RUN dnf install --assumeyes unzip git
@@ -16,7 +14,10 @@ WORKDIR /src
RUN git clone https://github.com/Cian-H/am-d-model.eu.git
WORKDIR /src/am-d-model.eu
RUN bun install
RUN bun pm trust --all
RUN ls
RUN bunx vite build
RUN mkdir -p /var/www/site/
RUN bunx vite build --outDir /var/www/site/
RUN mv ./build/* /var/www/site/
ENTRYPOINT ["bun", "/var/www/site/index.js"]

View File

@@ -1,3 +1,3 @@
http://127.0.0.1 {
reverse-proxy am-d-model-site:8080
reverse_proxy am-d-modeleu_site_1:8080
}

38
docker-compose.yaml Normal file
View File

@@ -0,0 +1,38 @@
version: "3.8"
networks:
am-d-model-network:
name: am-d-model-network
services:
site:
build: .
networks:
- host
- am-d-model-network
restart: unless-stopped
caddy:
image: caddy:latest
networks:
- am-d-model-network
ports:
- "3000:80"
volumes:
- caddy_data:/data
- caddy_config:/config
command: >
sh -c "wget -O /etc/caddy/Caddyfile https://raw.githubusercontent.com/Cian-H/am-d-model.eu/refs/heads/main/conf/Caddyfile &&
caddy run --config /etc/caddy/Caddyfile"
restart: unless-stopped
# watchtower:
# image: containrrr/watchtower
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock
# command: --interval 30 --cleanup
# restart: unless-stopped
volumes:
caddy_data:
caddy_config:

View File

@@ -32,4 +32,8 @@ export default defineConfig({
cssMinify: true,
cssCodeSplit: true
},
server: {
host: "0.0.0.0",
port: 3000,
},
});