-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
296 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#### | ||
# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode. | ||
# | ||
# Before building the container image run: | ||
# | ||
# ./mvnw package -Pnative | ||
# | ||
# Then, build the image with: | ||
# | ||
# docker build -f src/main/docker/Dockerfile.native -t playwright/integration-test . | ||
# | ||
# Then run the container using: | ||
# | ||
# docker run -i --rm -p 8080:8080 playwright/integration-test | ||
# | ||
### | ||
FROM mcr.microsoft.com/playwright:v1.48.1-noble | ||
|
||
WORKDIR /work/ | ||
|
||
# Set permissions for /work directory and grant full access to /tmp | ||
RUN chown 1001:root /work \ | ||
&& chmod g+rwX /work \ | ||
&& chown 1001:root /work | ||
|
||
# Copy necessary files and adjust permissions | ||
COPY --chown=1001:root target/*.properties target/*.so /work/ | ||
COPY --chown=1001:root target/*-runner /work/application | ||
|
||
# Make application executable for all users | ||
RUN chmod ugo+x /work/application | ||
|
||
EXPOSE 8080 | ||
USER 1001 | ||
|
||
CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
runtime/src/main/java/io/quarkiverse/playwright/runtime/PlaywrightRecorder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package io.quarkiverse.playwright.runtime; | ||
|
||
import java.io.IOException; | ||
import java.net.URI; | ||
import java.net.URISyntaxException; | ||
import java.nio.file.FileSystem; | ||
import java.nio.file.FileSystems; | ||
import java.util.Collections; | ||
|
||
import org.jboss.logging.Logger; | ||
|
||
import com.microsoft.playwright.impl.driver.jar.DriverJar; | ||
|
||
import io.quarkus.runtime.annotations.Recorder; | ||
|
||
@Recorder | ||
public class PlaywrightRecorder { | ||
|
||
private static final Logger log = Logger.getLogger(PlaywrightRecorder.class); | ||
|
||
public void initialize() { | ||
try { | ||
URI uri = DriverJar.getDriverResourceURI(); | ||
log.infof("Playwright Driver: %s", uri); | ||
FileSystem fs = FileSystems.newFileSystem(uri, Collections.emptyMap()); | ||
if (fs == null) { | ||
log.errorf("FileSystem Error NULL: %s", uri); | ||
} | ||
DriverJar jar = new DriverJar(); | ||
log.debugf("Playwright Driver Directory: %s", jar.driverDir()); | ||
} catch (URISyntaxException | IOException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
} |