added dockerfile and updated Readme
This commit is contained in:
11
Dockerfile
Normal file
11
Dockerfile
Normal file
@@ -0,0 +1,11 @@
|
||||
# Use the official Nginx image as the base image
|
||||
FROM nginx:alpine
|
||||
|
||||
# Remove the default Nginx static files
|
||||
RUN rm -rf /usr/share/nginx/html/*
|
||||
|
||||
# Copy all your app's files into the Nginx directory
|
||||
COPY . /usr/share/nginx/html
|
||||
|
||||
# Expose port 80
|
||||
EXPOSE 80
|
||||
67
README.md
67
README.md
@@ -1,3 +1,68 @@
|
||||
# game-timer
|
||||
# Game Timer
|
||||
|
||||
Multi-player chess timer with carousel navigation
|
||||
|
||||
# PWA Containerized Deployment
|
||||
|
||||
This document provides step-by-step instructions to pull the source code and deploy the Progressive Web App (PWA) using Docker on a production server.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- **Git:** Installed on your production server.
|
||||
- **Docker:** Installed and running on your production server.
|
||||
- **Basic Knowledge:** Familiarity with the command line.
|
||||
|
||||
## Steps
|
||||
|
||||
### 1. Clone the Repository
|
||||
|
||||
Log in to your production server and navigate to the directory where you want to store the project. Then run:
|
||||
|
||||
```bash
|
||||
git clone https://gitea.virtonline.eu/2HoursProject/game-timer.git
|
||||
cd game-timer
|
||||
```
|
||||
|
||||
### 2. Build the docker image
|
||||
|
||||
From the repository root, run the following command to build your Docker image:
|
||||
|
||||
```bash
|
||||
docker build -t 'game-timer:latest' .
|
||||
```
|
||||
|
||||
### 3. Run the Docker Container
|
||||
|
||||
Once the image is built, run the container on port 8080 with:
|
||||
|
||||
```bash
|
||||
docker run -d -p 8080:80 --name game-timer-container game-timer:latest
|
||||
```
|
||||
|
||||
### 4. Verify the Deployment
|
||||
|
||||
Check if it's running:
|
||||
|
||||
```bash
|
||||
docker ps
|
||||
```
|
||||
|
||||
View logs (if needed):
|
||||
|
||||
```bash
|
||||
docker logs game-timer-container
|
||||
```
|
||||
|
||||
After running the container, open your web browser and navigate to:
|
||||
|
||||
```bash
|
||||
http://localhost
|
||||
```
|
||||
|
||||
### 5. Terminate
|
||||
|
||||
To stop your running game-timer-container, use:
|
||||
|
||||
```bash
|
||||
docker stop game-timer-container
|
||||
```
|
||||
Reference in New Issue
Block a user