Skip to content

Commit

Permalink
Dockerfiles yuhu
Browse files Browse the repository at this point in the history
  • Loading branch information
larsLotNav committed May 20, 2021
1 parent d7882e4 commit 9bd4d1e
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.idea
frontend
gen
node_modules
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM maven:3.6.3-openjdk-11 as maven

COPY pom.xml pom.xml

COPY . .

RUN mvn clean install

RUN mvn dependency:go-offline -B

RUN mvn package

FROM openjdk:11

#RUN dir #Added

WORKDIR /adevguide

EXPOSE 3001


#RUN dir #Added


COPY --from=maven portal-server/target/portal-server-0.1-SNAPSHOT.jar ./portal-server.jar

CMD ["java", "-jar", "./portal-server.jar"]
28 changes: 28 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Base on offical Node.js Alpine image
FROM node:alpine

# Set working directory
WORKDIR /usr/app

# Copy package.json and package-lock.json before other files
# Utilise Docker cache to save re-installing dependencies if unchanged
COPY ./package*.json ./

# Install dependencies
RUN npm install --production

# Copy all files
COPY .. ./

# Build app
RUN npm run build

# Expose the listening port
EXPOSE 3000

# Run container as non-root (unprivileged) user
# The node user is provided in the Node.js Alpine base image
USER node

# Run npm start script when container starts
CMD [ "npm", "start" ]
2 changes: 1 addition & 1 deletion portal-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>no.nav.server.NavServer</mainClass>
<mainClass>no.nav.server.PortalServer</mainClass>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
Expand Down

0 comments on commit 9bd4d1e

Please sign in to comment.