Has anyone deployed oxygen to a docker container ? #103
Replies: 2 comments 5 replies
-
@IoannisMaras Fair warning this image is not optimized and pulls in all your packages along with Julia itself. So this image ends up being around 500mb on my computer. I'd recommend looking into StaticCompiler.jl and the PackageCompiler.j to create smaller executables which should result in a much smaller image. # Base image
FROM julia:1.6
# Set the working directory
WORKDIR /app
# Copy the Project.toml and Manifest.toml files into the image to manage dependencies
COPY Project.toml Manifest.toml ./
# Install the dependencies in a separate layer to improve caching
RUN julia --project -e 'using Pkg; Pkg.instantiate()'
# Copy the source code into the image
COPY src/ ./src
# Expose the desired port
EXPOSE 8080
# Set the entrypoint to start the application
ENTRYPOINT ["julia", "--project", "src/main.jl"] Commands to build & run docker build -t oxygen-app .
docker run -p 8080:8080 oxygen-app My project structure |
Beta Was this translation helpful? Give feedback.
-
Here's our Dockerfile https://github.com/open-AIMS/ReefGuideAPI.jl/blob/main/Dockerfile |
Beta Was this translation helpful? Give feedback.
-
I manage to deploy it and it runs fine , but no matter what I cannot send an http request to oxygen . So I want wondering if anyone managed to do it and if so how?
Beta Was this translation helpful? Give feedback.
All reactions