Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docker): Quickstart app with docker #136

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

amritupreti
Copy link
Contributor

This PR adds a Dockerfile and docker-compose.yml to containerize the application. The Dockerfile sets up multi-stage builds for the front-end and back-end, while docker-compose.yml orchestrates container deployment with persistent storage for uploaded files and database data.

Key Changes:
Dockerfile: Multi-stage build for Node.js and Go applications.
docker-compose.yml: Manages service orchestration and persistence.

Instructions:
Start the application:
docker-compose up -d

Please review and provide feedback.

@amritupreti
Copy link
Contributor Author

I have separated feat and docs in separate PR.

@yunimoo yunimoo mentioned this pull request Jul 23, 2024
@yunimoo
Copy link
Contributor

yunimoo commented Jul 23, 2024

Looks good 👍

I think that we may need to add another Dockerfile for the workflow or modify this one to include multiple targets. What do you think about that?

One issue that I have ran into with the docker actions is that building it with respect to the runner may not work on intended architectures. For example, the runner is amd64 and thus will deploy the image in an amd64 environment even though the target might be arm64.

Comment on lines +20 to +21
# Run the binary in a alpine container
FROM ubuntu:22.04
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alpine image would be a nice to have over ubuntu, any chance if this could be done? I believe that an alpine image should be lighter than ubuntu?

FROM ubuntu:22.04
WORKDIR /app
COPY --from=gowork /app/main .
CMD [ "./main" ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
CMD [ "./main" ]
CMD [ "./main" ]

@@ -0,0 +1,13 @@
services:
server:
image: go-fast-cdn
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving this as a note, but if we decide to go the official image route we will need to change this

Copy link
Owner

@kevinanielsen kevinanielsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@kevinanielsen kevinanielsen merged commit 68b3871 into kevinanielsen:main Jul 26, 2024
2 checks passed
@kevinanielsen kevinanielsen linked an issue Jul 26, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docker Functionality
3 participants