mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-08 10:20:41 +00:00
Installation instructions
This commit is contained in:
parent
26caed074d
commit
27a2c45aa2
18
Dockerfile
18
Dockerfile
@ -4,19 +4,19 @@ RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
|
||||
RUN apt-get update -qq && apt-get install -qq --no-install-recommends nodejs
|
||||
|
||||
# Stop running as root at this point
|
||||
RUN useradd -m myuser
|
||||
RUN useradd -m typicalc
|
||||
WORKDIR /usr/src/app/
|
||||
RUN chown myuser:myuser /usr/src/app/
|
||||
USER myuser
|
||||
RUN chown typicalc:typicalc /usr/src/app/
|
||||
USER typicalc
|
||||
|
||||
# Copy pom.xml and prefetch dependencies so a repeated build can continue from the next step with existing dependencies
|
||||
COPY --chown=myuser pom.xml ./
|
||||
COPY --chown=typicalc pom.xml ./
|
||||
RUN mvn dependency:go-offline -Pproduction
|
||||
|
||||
# Copy all needed project files to a folder
|
||||
COPY --chown=myuser:myuser src src
|
||||
COPY --chown=myuser:myuser frontend frontend
|
||||
COPY --chown=myuser:myuser package.json pnpm-lock.yaml webpack.config.js ./
|
||||
COPY --chown=typicalc:typicalc src src
|
||||
COPY --chown=typicalc:typicalc frontend frontend
|
||||
COPY --chown=typicalc:typicalc package.json pnpm-lock.yaml webpack.config.js ./
|
||||
|
||||
|
||||
# Build the production package, assuming that we validated the version before so no need for running tests again
|
||||
@ -25,7 +25,7 @@ RUN mvn clean package -DskipTests -Pproduction
|
||||
# Running stage: the part that is used for running the application
|
||||
FROM openjdk:11
|
||||
COPY --from=build /usr/src/app/target/*.jar /usr/app/app.jar
|
||||
RUN useradd -m myuser
|
||||
USER myuser
|
||||
RUN useradd -m typicalc
|
||||
USER typicalc
|
||||
EXPOSE 8080
|
||||
CMD java -jar /usr/app/app.jar
|
||||
|
14
README.md
14
README.md
@ -53,24 +53,26 @@ More samples can be added to `src/test/resources/terms/` to speed up the process
|
||||
|
||||
## Deploying using Docker
|
||||
|
||||
To build the Dockerized version of the project, run
|
||||
To build the Dockerized version of the project, run:
|
||||
|
||||
```
|
||||
docker build . -t myapp:latest
|
||||
docker build . -t typicalc:latest
|
||||
```
|
||||
|
||||
Once the Docker image is correctly built, you can test it locally using
|
||||
Once the Docker image is correctly built, you can run it:
|
||||
|
||||
```
|
||||
docker run -p 80:8080 myapp:latest
|
||||
docker run -p 80:8080 typicalc:latest
|
||||
```
|
||||
|
||||
## Deploying using a JAR
|
||||
|
||||
First build the project:
|
||||
First build the application:
|
||||
|
||||
```
|
||||
mvn package -Pproduction
|
||||
mvn clean package -Pproduction
|
||||
```
|
||||
|
||||
Then run the server:
|
||||
```
|
||||
PORT=80 java -jar target/typicalc-1.0-SNAPSHOT.jar
|
||||
|
Loading…
Reference in New Issue
Block a user