Skip to content

Commit

Permalink
Added support for M1 CPU
Browse files Browse the repository at this point in the history
  • Loading branch information
roblaszczak committed May 24, 2022
1 parent a9b1a1b commit 8d77be0
Show file tree
Hide file tree
Showing 12 changed files with 6,457 additions and 4,183 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ terraform/cloud-builders-community
!/web/src/repositories/clients/users/src/

/service-account-file.json

.go/
.go-cache/
27 changes: 23 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
version: '3'
version: '3.8'
name: 'wild-workouts'
services:
web:
build:
Expand All @@ -16,6 +17,8 @@ services:
context: docker/app
volumes:
- ./internal:/internal
- ./.go/pkg:/go/pkg
- ./.go-cache:/go-cache
# - ./service-account-file.json:$SERVICE_ACCOUNT_FILE
working_dir: /internal/trainer
ports:
Expand All @@ -24,6 +27,7 @@ services:
- .env
environment:
SERVER_TO_RUN: http
GOCACHE: /go-cache
depends_on:
- firestore

Expand All @@ -32,6 +36,8 @@ services:
context: docker/app
volumes:
- ./internal:/internal
- ./.go/pkg:/go/pkg
- ./.go-cache:/go-cache
# - ./service-account-file.json:$SERVICE_ACCOUNT_FILE
working_dir: /internal/trainer
ports:
Expand All @@ -40,6 +46,7 @@ services:
- .env
environment:
SERVER_TO_RUN: grpc
GOCACHE: /go-cache
depends_on:
- firestore

Expand All @@ -48,12 +55,16 @@ services:
context: docker/app
volumes:
- ./internal:/internal
- ./.go/pkg:/go/pkg
- ./.go-cache:/go-cache
# - ./service-account-file.json:$SERVICE_ACCOUNT_FILE
working_dir: /internal/trainings
ports:
- "127.0.0.1:3001:$PORT"
env_file:
- .env
environment:
GOCACHE: /go-cache
depends_on:
- firestore

Expand All @@ -62,12 +73,15 @@ services:
context: docker/app
volumes:
- ./internal:/internal
- ./.go/pkg:/go/pkg
- ./.go-cache:/go-cache
# - ./service-account-file.json:$SERVICE_ACCOUNT_FILE
working_dir: /internal/users
ports:
- "127.0.0.1:3002:$PORT"
environment:
SERVER_TO_RUN: http
GOCACHE: /go-cache
env_file:
- .env
depends_on:
Expand All @@ -78,19 +92,23 @@ services:
context: docker/app
volumes:
- ./internal:/internal
- ./.go/pkg:/go/pkg
- ./.go-cache:/go-cache
# - ./service-account-file.json:$SERVICE_ACCOUNT_FILE
working_dir: /internal/users
ports:
- "127.0.0.1:3020:$PORT"
environment:
SERVER_TO_RUN: grpc
GOCACHE: /go-cache
env_file:
- .env
depends_on:
- firestore

firestore:
image: karhoo/firestore-emulator:0.3.2
build:
context: docker/firestore-emulator
env_file:
- .env
ports:
Expand All @@ -99,15 +117,16 @@ services:
restart: unless-stopped

firestore-component-tests:
image: karhoo/firestore-emulator:0.3.2
build:
context: docker/firestore-emulator
env_file:
- .env
ports:
- "127.0.0.1:8788:8787"
restart: unless-stopped

mysql:
image: mysql:8
image: mariadb:10
env_file:
- .env
volumes:
Expand Down
5 changes: 5 additions & 0 deletions docker/firestore-emulator/.firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "threedotslabs-cloudnative"
}
}
12 changes: 12 additions & 0 deletions docker/firestore-emulator/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM node:16.15.0-alpine3.15

RUN apk add --no-cache openjdk8-jre
RUN apk add --no-cache bash

RUN npm install -g firebase-tools@10.9.2

COPY start.sh .
COPY firebase.json .
COPY .firebaserc .

ENTRYPOINT ["./start.sh"]
21 changes: 21 additions & 0 deletions docker/firestore-emulator/firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"emulators": {
"hub": {
"host": "0.0.0.0",
"port": 4400
},
"firestore": {
"host": "0.0.0.0",
"port": 8787
},
"ui": {
"enabled": true,
"host": "0.0.0.0",
"port": 4000
},
"auth": {
"port": 9099,
"host": "0.0.0.0"
}
}
}
4 changes: 4 additions & 0 deletions docker/firestore-emulator/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -xe

firebase emulators:start
4 changes: 2 additions & 2 deletions docker/web/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM node:13.11.0-alpine3.11
FROM node:12.22.8-alpine3.13

ENV NODE_ENV development

RUN apk add yarn
RUN apk --no-cache add yarn python2 make gcc g++
ADD start.sh /
RUN chmod +x /start.sh

Expand Down
9 changes: 9 additions & 0 deletions internal/trainings/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/getkin/kin-openapi v0.80.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
Expand Down Expand Up @@ -223,8 +224,12 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU=
github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg=
github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down Expand Up @@ -322,6 +327,7 @@ golang.org/x/mod v0.4.1 h1:Kvvh58BN8Y9/lBi7hTekvtMpm07eUZ0ck5pRHpsMWrY=
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
Expand Down Expand Up @@ -373,6 +379,7 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand All @@ -386,6 +393,7 @@ golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down Expand Up @@ -599,6 +607,7 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
Expand Down
2 changes: 1 addition & 1 deletion sql/schema.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CREATE TABLE `hours`
(
hour TIMESTAMP NOT NULL,
hour TIMESTAMP NOT NULL DEFAULT 0,
availability ENUM ('available', 'not_available', 'training_scheduled') NOT NULL,
PRIMARY KEY (hour)
);
Loading

0 comments on commit 8d77be0

Please sign in to comment.