mirror of
https://github.com/davegallant/rfd-fyi.git
synced 2025-08-05 23:03:39 +00:00
Add Caddyfile rather than nginx
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,4 +1,5 @@
|
|||||||
node_modules
|
node_modules
|
||||||
|
dist
|
||||||
backend/bin/
|
backend/bin/
|
||||||
.vscode
|
.vscode
|
||||||
*.pem
|
*.pem
|
||||||
|
5
Caddyfile
Normal file
5
Caddyfile
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
rfd.fyi
|
||||||
|
|
||||||
|
file_server
|
||||||
|
|
||||||
|
reverse_proxy /api/* backend:8080
|
10
Dockerfile
10
Dockerfile
@@ -10,11 +10,11 @@ COPY . .
|
|||||||
|
|
||||||
RUN yarn build
|
RUN yarn build
|
||||||
|
|
||||||
FROM nginx:stable-alpine as production-stage
|
FROM caddy:2.5.2-alpine as production-stage
|
||||||
|
|
||||||
COPY --from=build-stage /app/dist /usr/share/nginx/html
|
WORKDIR /my-site
|
||||||
|
|
||||||
COPY nginx.conf /etc/nginx/
|
COPY --from=build-stage /app/dist ./
|
||||||
|
|
||||||
|
COPY Caddyfile /etc/caddy/Caddyfile
|
||||||
|
|
||||||
EXPOSE 80
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
|
||||||
|
@@ -3,8 +3,10 @@ services:
|
|||||||
frontend:
|
frontend:
|
||||||
build:
|
build:
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
|
context: .
|
||||||
ports:
|
ports:
|
||||||
- 80:80
|
- 80:80
|
||||||
|
- 443:443
|
||||||
links:
|
links:
|
||||||
- "backend:backend"
|
- "backend:backend"
|
||||||
backend:
|
backend:
|
||||||
|
30
nginx.conf
30
nginx.conf
@@ -1,30 +0,0 @@
|
|||||||
events {
|
|
||||||
worker_connections 1024;
|
|
||||||
}
|
|
||||||
|
|
||||||
http {
|
|
||||||
|
|
||||||
upstream backend {
|
|
||||||
server backend:8080;
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 80 default_server;
|
|
||||||
listen [::]:80 default_server;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /api/ {
|
|
||||||
proxy_pass http://backend;
|
|
||||||
proxy_redirect off;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Host $server_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@@ -39,7 +39,7 @@
|
|||||||
></a>
|
></a>
|
||||||
</td>
|
</td>
|
||||||
<td scope="col">{{ topic.total_views }}</td>
|
<td scope="col">{{ topic.total_views }}</td>
|
||||||
<td scope="col">{{ topic.score }}</td>
|
<!-- <td scope="col">{{ topic.score }}</td> -->
|
||||||
<!-- <td scope="col">{{ topic.votes.up - topic.votes.down }}</td> -->
|
<!-- <td scope="col">{{ topic.votes.up - topic.votes.down }}</td> -->
|
||||||
<td scope="col">{{ formatDate(topic.last_post_time) }}</td>
|
<td scope="col">{{ formatDate(topic.last_post_time) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
Reference in New Issue
Block a user