Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding docker #19

Merged
merged 6 commits into from Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/codeql/codeql-config.yml
@@ -0,0 +1,3 @@
name: "CodeQL config"
paths-ignore:
- Frontend
17 changes: 17 additions & 0 deletions docker/Chat.Dockerfile
@@ -0,0 +1,17 @@
# Use an official lightweight Nginx image
FROM nginx:alpine

# Remove the default server definition
RUN rm /etc/nginx/conf.d/default.conf

# Copy the custom Nginx config
COPY ./docker/default.conf /etc/nginx/conf.d/

# Copy the static site files to the nginx server directory
COPY ./Frontend /usr/share/nginx/html

# Expose port 80 to the outside once the container has launched
EXPOSE 80

# # Start nginx and keep the process from backgrounding and the container from quitting
CMD ["nginx", "-g", "daemon off;"]
Empty file added docker/README.md
Empty file.
15 changes: 15 additions & 0 deletions docker/default.conf
@@ -0,0 +1,15 @@
server {
listen 80;
server_name localhost;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}

error_page 500 502 503 504 /index.html;
location = index.html {
root /usr/share/nginx/html;
}
}
7 changes: 6 additions & 1 deletion package.json
Expand Up @@ -29,7 +29,12 @@
"serve:https": "serve -s Frontend --listen 4433 --ssl-cert ./local-ssl-keys/cert.pem --ssl-key ./local-ssl-keys/key.pem",
"serve:ssl": "http-server -S -C ./local-ssl-keys/cert.pem -K ./local-ssl-keys/key.pem Frontend",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
"build-storybook": "storybook build",
"docker:build": "sudo docker build -t chat -f docker/Chat.Dockerfile . --no-cache",
"docker:run": "sudo docker run --name chat-container -p 1234:80 chat",
"docker:stop": "sudo docker stop chat-container",
"docker:rm": "sudo docker rm -f chat-container",
"docker:exec": "sudo docker exec -it chat-container /bin/sh"
},
"author": "",
"license": "GPL-3.0",
Expand Down