Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Use a base image with Java and Maven pre-installed
FROM maven:latest

# Set the working directory in the container
WORKDIR /app

# Clone the repository into the container
RUN git clone https://github.com/JeremyTsaii/leetcode-stats-api.git .
# Run Maven clean command
RUN mvn clean

# Run Maven package command
RUN mvn package

# Expose the port used by Apache Tomcat
EXPOSE 8080

# Command to serve the Apache Tomcat servlet container
CMD ["mvn", "spring-boot:run"]
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,12 @@ Serves the Apache Tomcat servlet container on http://localhost:8080.
#### `mvn test`

Runs all the tests.

## By using Docker

first build the docker image

### docker build -t <ANY_TAG_NAME> .

run the docker container
### docker run -d -p 8080:8080 <ANY_TAG_NAME>