Skip to content

Instantly share code, notes, and snippets.

@cognivore
Last active December 4, 2021 22:58
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save cognivore/93eaf78a481c6120477d58ec1e3f1113 to your computer and use it in GitHub Desktop.
WSL2: No port forwarding to host problem (take 2)
version: '3'
services:
db:
image: "postgres:14.1"
ports:
- "5432:5432"
tmpfs:
- /var/lib/postgresql/data
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
environment:
POSTGRES_DB: zhr
POSTGRES_PASSWORD: postgres
networks:
- hobbit
web:
build: .
ports:
- "8080"
expose:
- "8080"
networks:
- hobbit
depends_on:
- "db"
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://db:5432/zhr
networks:
hobbit:
driver: bridge
FROM gradle:7.3.0-jdk17 as builder
WORKDIR /app
COPY . /app/
RUN gradle --no-daemon bootJar
FROM openjdk:17-slim
COPY --from=builder /app/build/libs/evaluation-task-LATEST.jar /opt/app.jar
EXPOSE 8080
USER 65534:65534
ENTRYPOINT java \
-Djava.security.egd=file:/dev/urandom \
-jar /opt/app.jar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment