Compare commits

..

4 Commits

Author SHA1 Message Date
db4ea90a99 update docker-compose.yml 2024-04-06 17:50:34 -04:00
8f2d6b1613 add Dockerfile and nginx configuration 2024-04-06 17:50:21 -04:00
45c7886090 refactor: create src directory 2024-04-06 17:27:23 -04:00
327f8e4964 ignore .idea 2024-04-06 17:15:57 -04:00
7 changed files with 55 additions and 0 deletions

View File

@ -4,6 +4,16 @@ services:
build:
context: ./backend
dockerfile: Dockerfile
ports:
- '8001:8000'
restart: unless-stopped
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- '8000:8000'
restart: unless-stopped
depends_on:
- backend

1
frontend/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.idea/

8
frontend/Dockerfile Normal file
View File

@ -0,0 +1,8 @@
FROM nginx:stable-alpine
COPY ./conf/nginx.conf /etc/nginx/nginx.conf
WORKDIR /app
COPY ./src/. .
EXPOSE 8000

22
frontend/conf/nginx.conf Normal file
View File

@ -0,0 +1,22 @@
events {
worker_connections 1024;
}
http {
server {
listen 8000 default_server;
listen [::]:8000 default_server;
root /app;
index index.html;
server_name _;
location / {
try_files $uri $uri/ =404;
}
location /api/ {
proxy_pass http://backend:8000/;
}
}
}

View File

View File

14
frontend/src/index.html Normal file
View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>Single-board Forum</title>
<link rel="stylesheet" href="assets/css/main.css">
<meta charset="UTF-8">
<script src="assets/js/app.js" type="module"></script>
</head>
<body>
<header>
<h1>Single-board Forum</h1>
</header>
</body>
</html>