-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Setup docker Setup Docker image and hosted it on Docker Hub * [Finishes #187584909] Completed to setup docker
- Loading branch information
1 parent
8dc854a
commit bab5704
Showing
6 changed files
with
76 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
FROM postgres:latest |
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,13 @@ | ||
FROM node:20-alpine | ||
|
||
WORKDIR /app | ||
|
||
COPY ./package.json . | ||
|
||
RUN npm install | ||
|
||
COPY . . | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["npm", "start"] |
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,22 @@ | ||
### Building and running your application | ||
|
||
When you're ready, start your application by running: | ||
`docker compose up --build`. | ||
|
||
Your application will be available at http://localhost:3000. | ||
|
||
### Deploying your application to the cloud | ||
|
||
First, build your image, e.g.: `docker build -t myapp .`. | ||
If your cloud uses a different CPU architecture than your development | ||
machine (e.g., you are on a Mac M1 and your cloud provider is amd64), | ||
you'll want to build the image for that platform, e.g.: | ||
`docker build --platform=linux/amd64 -t myapp .`. | ||
|
||
Then, push it to your registry, e.g. `docker push myregistry.com/myapp`. | ||
|
||
Consult Docker's [getting started](https://docs.docker.com/go/get-started-sharing/) | ||
docs for more detail on building and pushing. | ||
|
||
### References | ||
* [Docker's Node.js guide](https://docs.docker.com/language/nodejs/) |
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,28 @@ | ||
version: "3" | ||
|
||
services: | ||
server: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.server | ||
ports: | ||
- "3000:3000" | ||
env_file: | ||
- .env | ||
depends_on: | ||
- database | ||
|
||
database: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.database | ||
ports: | ||
- "5432:5432" | ||
environment: | ||
DATABASE_USER: ${DOCKER_DATABASE_USER} | ||
DATABASE_NAME: ${DOCKER_DATABASE_NAME} | ||
DATABASE_PASSWORD: ${DOCKER_DATABASE_PASSWORD} | ||
POSTGRES_USER: ${DOCKER_DATABASE_USER} | ||
POSTGRES_NAME: ${DOCKER_DATABASE_NAME} | ||
POSTGRES_PASSWORD: ${DOCKER_DATABASE_PASSWORD} | ||
POSTGRES_HOST_AUTH_METHOD: ${DOCKER_DATABASE_HOST_AUTH_METHOD} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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