Skip to content

Commit 4e771aa

Browse files
committed
feat: add reverse proxy
1 parent c7ea15e commit 4e771aa

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

Dockerfiles/Dockerfile.backend

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
FROM node:20-bookworm
22

3+
# install Nginx
4+
RUN apt-get update && apt-get install nginx -y
5+
COPY ../Dockerfiles/nginx/default /etc/nginx/sites-available/default
6+
7+
# install backend
38
WORKDIR /web/backend
49
COPY ../web/backend .
510
RUN npm install
6-
ENTRYPOINT ["npm", "start"]
11+
ENTRYPOINT ["/bin/bash", "-c", "/usr/sbin/nginx && npm start"]
712

Dockerfiles/nginx/default

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
server {
2+
listen 80;
3+
location / {
4+
proxy_pass http://dela-leader:8080;
5+
}
6+
}

README.docker.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The relevant files are:
1111
You need to create a local .env file with the following content:
1212

1313
```
14-
DELA_NODE_URL=http://dela-leader:8080 # Dela node URL *within the Docker network* (port must be in DELA_PROXY_PORT_RANGE)
14+
DELA_NODE_URL=http://127.0.0.1:80 # reverse proxy within backend container
1515
DATABASE_USERNAME=dvoting # choose any PostgreSQL username
1616
DATABASE_PASSWORD= # choose any PostgreSQL password
1717
DATABASE_HOST=db # PostgreSQL host *within the Docker network*

0 commit comments

Comments
 (0)