Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
uz1pk committed Aug 22, 2023
1 parent f992d0e commit 0997f22
Show file tree
Hide file tree
Showing 11 changed files with 13,350 additions and 9,144 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
*.so
*.dylib

.yarn/
.yarnrc.yml

# Test binary, built with `go test -c`
*.test

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ Wanted to learn a bit of GO and spin up a Go web server. Created this little sid

## Infrastructure
- Docker
- Wanted to deploy or GCP or AWS but too expenseive : (
- Wanted to deploy or GCP or AWS but too expensive : (

![Demo image](/demo/demo.png)
20 changes: 20 additions & 0 deletions client/DockerFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Use the official Node.js image as a base
FROM node:14

# Set the working directory in the container
WORKDIR /app

# Copy package.json and package-lock.json to the container
COPY package*.json ./

# Install app dependencies
RUN npm install

# Copy all the app files to the container
COPY . .

# Expose the app's port
EXPOSE 3000

# Start the app
CMD ["npm", "start"]
22,421 changes: 13,278 additions & 9,143 deletions client/yarn.lock

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: "3"
services:
postgres:
image: postgres:latest
environment:
POSTGRES_DB: admin
POSTGRES_USER: admin
POSTGRES_PASSWORD: test
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data

react-app:
build:
context: ./client
ports:
- "3000:3000"
depends_on:
- go-server

go-server:
build:
context: ./go-server
ports:
- "8080:8080"
depends_on:
- postgres

volumes:
postgres_data:
17 changes: 17 additions & 0 deletions go-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Use the official Golang image as a base
FROM golang:1.17

# Set the working directory in the container
WORKDIR /app

# Copy the source code into the container
COPY . .

# Build the Golang application
RUN go build -o main .

# Expose the server's port
EXPOSE 8080

# Start the server
CMD ["./main"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 0997f22

Please sign in to comment.