Last active
June 5, 2024 19:23
-
-
Save sallyom/8f46ad519fc471b9dc13af029e03b439 to your computer and use it in GitHub Desktop.
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
See the tutorial below. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fork and clone PacMan repository
Check out a new branch
We'll roughly follow the README.md
for the program's frontend.
Build PacMan
Use the commands and submit the form listed below.
If you forget to add the
--it
flags to the run command, it will be tricky to stop the container.If this happens, open another terminal and run
podman stop --all
Note: For people on windows, create another Containerfile with the following lines and build it
Add these lines to the windows-containerfile
Then run the following command to build your image
Run the built image
Now run the newly built image.
--rm
ensures the container will be cleaned up after you stop the container.Add the
-d
to run this container in the background.With
-p 8080:8080
port-forward port 8080 from the running container to port 8080 on your local system.Name your container
pacman
to easily view the logs.You can see the container logs by running:
$ podman logs pacman NODE VERSION: v18.14.2 NPM VERSION: 9.5.0 run pacman PACMAN auth_details = pacman:pacman@ DATABASE URL mongodb://pacman:pacman@mongodb:27017/pacman CONNECTING mongodb://pacman:pacman@mongodb:27017/pacman Options { readPreference: 'secondaryPreferred' } Listening on port 8080
To play
PACMAN
, head to your browser athttp://localhost:8080
EXTRA CREDIT
: Make a change (any change!) that is visible when the program is run. Build and push that image.EXTRA EXTRA CREDIT
: Configure the mongo database to keep records of games played with best scores. Explain how you did it.You can use Podman, Docker, or any other container build tool.
Push the built image to docker hub
You can push the image built to your docker hub account if you want. Replace with your docker hub username.
To clean up your system after running and building the pacman image (after you're done with the assignment):